Toggle
Bold Toggle
A bold toggle above a text sample: pressing it restyles the sample at once, so it reads as an action on an object rather than a form setting.
What you can change
- the sample text through text
- the button name through label — it also becomes aria-label and title
- 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-001?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, its own --vibeui-toggle-001-* palette. Client-side: the state is held by useState. The button declares its state through aria-pressed rather than checked: a toggle is an immediate action on a view or an object (make the selection bold), a switch is a setting that turns a mode on, and a checkbox is a form field that travels to the server on submit. The pressed look is picked by the selector button[aria-pressed="true"], so the markup and the style cannot drift apart. The sample text sits beside it and receives font-weight through data-bold on the root — the effect is visible the same instant.
Tags
- toggle
- aria-pressed
- formatting
- editor
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
Loading…