Button
Favorite Star
A favourite button with a counter: the star fills in, the number next to it updates instantly, and the counter itself stays out of the button's name.
React + Tailwind, shadcn-compatible: press “Copy for AI” and your Cursor or Claude Code agent installs it with the shadcn CLI.
What you can change
- the object heading through title
- the base number through count
- the button name through label
A link for your AI agent: preview, code and instructions.
Preview

Use it with AI
- 1. Copy the link.
- 2. Write to your agent in your own words and drop the link into the sentence.
- 3. The agent opens the link and installs the component from the registry.
put this on the home page as the hero:
https://vibeui.club/c/toggle-003?lang=en&theme=dark
Not sure where to paste it? Step-by-step guide
Show the full instructions
What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.
Loading…
How to use
<Toggle003
title="Annual sales report"
count={128}
label="Add to favourites"
/>A sample call. The agent installs the component itself from the registry via the “Copy for AI” link.
Settings
- Heading
title· default: Annual sales report- Counter
count· default: 128- Button name
label· default: Add to favorites- Counter line
countText· default: {count} in favorites- Pressed
defaultPressed· default: off- Accent
accent· default: theme colour- Background
background· default: theme colour
More in Button
FAQ
- How do I add Favorite Star with Cursor or Claude Code?
- Press “Copy for AI” on this page and paste it into your agent's chat. The instruction contains the shadcn CLI install command, the dependencies and what to keep, so the agent installs this exact component instead of recreating a lookalike.
- What does Favorite Star depend on?
- No npm packages beyond React and Tailwind CSS.
- What can I change in Favorite Star?
- Adapt: the object heading through title; the base number through count; the button name through label. Keep as installed: the local --vibeui-toggle-003-* palette — do not swap it for your theme tokens; the counter outside the button: inside it becomes part of the name and clutters it; the filled star on top of the colour change — one hue alone cannot carry state.
- Is Favorite Star free?
- Yes. The preview is open without an account; with a free account you can copy up to 20 components a month.
For developers
npx shadcn@latest add https://vibeui.club/r/pro/toggle-003.jsonThis command needs a signed link: sign in and open “Component source” below — it issues a working link valid for 30 minutes. All install options
Technical notes
One file, zero dependencies, the --vibeui-toggle-003-* palette. Client-side: useState. The counter sits outside the button in a span with role="status": inside it would stick to the name and a screen reader would read "Add to favourites 128, pressed". The mark is shown by two cues — the star's fill through fill:currentColor and the border colour — and the short appearance animation is bound to [aria-pressed="true"] and switched off by prefers-reduced-motion. This is a toggle, not a checkbox: the favourite changes at once and belongs to the object, not to a form field.
Tags
- toggle
- favorite
- counter
- aria-pressed
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
Loading…