Toggle
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.
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.ru/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…
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-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…