Toggle
Pin Toggle
A toggle with an icon and a stable caption: the caption stays the name of the action, and the result is announced by a live line under the button.
What you can change
- the button name through label
- the result text through onLabel
- 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-002?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-002-* palette. Client-side: useState. The button caption does not change when pressed — only aria-pressed and the live role="status" line under it change. That is a deliberate decision: the caption is the button's name, and if it were rewritten to "Unpin", a screen reader would read the new name together with the state and produce "Unpin, pressed". The pressed state is shown by three cues at once — the filled icon (fill:currentColor on the path), the background and the word in the line — because one colour is not read by everyone. Unlike a switch, the action applies instantly and to a specific object.
Tags
- toggle
- aria-pressed
- pin
- icon
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
Loading…