Introducing Magic UI Pro - 50+ blocks and templates to build beautiful landing pages in minutes.

19.0k
165

Animated Subscribe Button

PreviousNext

An animated subscribe button useful for showing a micro animation from intial to final result.

Installation

pnpm dlx shadcn@latest add @magicui/animated-subscribe-button

Usage

import { AnimatedSubscribeButton } from "@/components/magicui/animated-subscribe-button";
<AnimatedSubscribeButton>
  <span>Follow</span>
  <span>Subscribed</span>
</AnimatedSubscribeButton>

Examples

Basic

Controlled (Async Behavior)

Props

PropTypeDefaultDescription
subscribeStatusbooleanfalseA boolean flag to check the condition for the button. This property can be used to toggle the button's state, such as subscribed or unsubscribed.
childrenReact.ReactNode-The content to be displayed inside the button. Should contain two children - first for unsubscribed state and second for subscribed state.
classNamestring-Optional class name to be applied to the button for custom styling.

Credits