Toggle
Heart Favorite
A round heart button with a numeric badge over its corner: the badge sits outside the button through absolute positioning and announces the count as its own live number.
What you can change
- the button name through label
- the starting count through count
- the initial state through defaultPressed
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.ru/c/toggle-009?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…
For developers
The install command lives in the “Component source” block below — a signed link that stays valid for 24 hours.
Technical notes
One file, zero dependencies, the --vibeui-toggle-009-* palette. Client-side: useState. The heart button carries aria-pressed, and the numeric badge lies beside it, absolutely positioned over its corner like a counter on a cart icon: it is not part of the button's text, so a screen reader does not glue the number to the name and the state into a single announcement. The change of the number is announced through role="status" on the badge itself. The heart's fill is picked by the selector button[aria-pressed="true"] svg path — the look and the state cannot drift apart.
Tags
- toggle
- aria-pressed
- favorite
- badge
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
Loading…