Skip to content

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.json

Usage

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

PropTypeDefaultDescription
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.
defaultPreferenceSubscribePreference"personalised"Level selected right after subscribing, and again after unsubscribing.
colorsreadonly string[]["#ff0033", …, "#f0287a"]Sparkle colors. The first and fourth also form the press flash gradient.
labelstring"Subscribe"Idle label.
subscribedLabelstring"Subscribed"Label once subscribed.
export type SubscribePreference = "all" | "personalised" | "none";