Rendyn

Component library

189 components

Interaction

Animated Subscribe Button

Animated Subscribe Button animates between its child states and an optional status prop.

Interactive exampleReact Tailwind CSS

Practical React example

Prototype the appearance of a subscribe action while keeping real subscription status outside the visual control.

Before you copy and paste

Match the imported component’s client or server rendering boundary before using the example. Copy components/magicui/animated-subscribe-button.tsx and its returned support files from the Code tab; preserve the project-relative paths.

Listed package dependencies: motion.

Use the Code tab for the component files and installation instructions, then adapt the imports in this example to your project.

Prototype the appearance of a subscribe action while keeping real subscription status outside the visual control

// Usage adapted from Magic UI's pinned MIT source.
// Copyright (c) Magic UI. See ./LICENSES.md.
'use client';

import { AnimatedSubscribeButton } from '@/components/magicui/animated-subscribe-button';

export function SubscribeAction({ subscribed, onSubscribe }: {
  subscribed: boolean;
  onSubscribe: () => void;
}) {
  return (
    <AnimatedSubscribeButton type="button" subscribeStatus={subscribed} disabled={subscribed} onClick={onSubscribe}>
      <span>Subscribe to updates</span>
      <span>Subscribed</span>
    </AnimatedSubscribeButton>
  );
}

Usage example adapted from Magic UI's pinned MIT source. Retain the source licence notices when copying.

Drive the visual state from an authoritative subscription response when integrating a real service. Read the pinned implementation before assuming its internal interaction persists data.

Customization

AnimatedSubscribeButtonProps.subscribeStatus
Optional; boolean.
AnimatedSubscribeButtonProps.children
Required; React.ReactNode.
AnimatedSubscribeButtonProps.className
Optional; string.

Integration notes

  • The source example does not send an email or create a subscription.
  • Show errors and pending state in the surrounding application instead of treating the animation as confirmation.
  • This pinned implementation requires exactly two direct span children for the initial and subscribed labels. The example supplies both and keeps subscribeStatus controlled.

Component source: Magic UI documentation . These examples describe the version imported into Rendyn. Upstream APIs may have changed; retain the source licence notices when adapting the code.

Better with your agent

Give your agent taste.

The best way to use Rendyn is through MCP. Let your agent find the right component, compare previews and bring the source into your project.

All components are free. Sign up only to connect MCP.

Connect to MCP