Follow Button

A pill that closes into a spinner, draws a check and opens as Following.

Preview

"use client";

import { FollowButton } from "@/components/motion/follow-button";

export function FollowButtonUsage() {
  return <FollowButton name="Maya Chen" />;
}

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/follow-button

API Reference

following?
boolean

Whether the user is following, for controlled use.

Default—
defaultFollowing?
boolean

Whether it starts in the following state when uncontrolled. Default: false

Defaultfalse
onFollowingChange?
((following: boolean) => void)

Called with the new state when the button is clicked.

Default—
name?
string

Who is being followed, for the accessible name ("Follow {name}").

Default—
labels?
Partial<{ follow: string; following: string; unfollow: string; followName: string; }>

Override any built-in string, e.g. for translation.

Default—
sound?
boolean

Play a crisp select on follow, lower on unfollow. Off by default; a `SoundProvider` can mute it app-wide.

Defaultfalse
className?
string

Classes merged onto the root element.

Default—

Updated