Subscribe Button
A subscribe pill that widens, flashes, rings its bell and throws sparkles — then opens a notification menu.
2 variantsNew
Preview
Installation
Copies the component into components/ui and installs its dependencies and theme tokens.
pnpm dlx shadcn@latest https://floret.shippedui.com/r/subscribe-button.jsonUsage
Pass your own data and wire the callbacks to your app.
import { SubscribeButton } from "@/components/ui/subscribe-button";
<SubscribeButton
onSubscribe={() => api.subscribe(channelId)}
onUnsubscribe={() => api.unsubscribe(channelId)}
onPreferenceChange={(level) => api.setNotifications(channelId, level)}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| onSubscribe | () => void | — | Fires on the first press. |
| onUnsubscribe | () => void | — | Fires when Unsubscribe is picked from the menu. |
| onPreferenceChange | (level: "all" | "personalised" | "none") => void | — | Fires when a notification level is picked. |
| defaultPreference | SubscribePreference | "personalised" | Level selected right after subscribing, and again after unsubscribing. |
| colors | readonly string[] | ["#ff0033", …, "#f0287a"] | Sparkle colors. The first and fourth also form the press flash gradient. |
| label | string | "Subscribe" | Idle label. |
| subscribedLabel | string | "Subscribed" | Label once subscribed. |
export type SubscribePreference = "all" | "personalised" | "none";