Toggle
Mute Toggle
A mute button with two state icons: both live in the markup and the one matching aria-pressed is shown.
What you can change
- the button name through label
- the volume level through volume
- 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-005?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-005-* palette. Client-side: useState. The technique: two <svg>s are always in the markup, and visibility is picked by the selectors button[aria-pressed="false"] [data-part="sound"] and button[aria-pressed="true"] [data-part="silent"] — the icon cannot drift from the state, because both come from a single attribute. The button's name stays constant, the state is spoken by the role="status" line. The volume bar dims through data-muted on the root: the state has to read from more than the icon. This is a toggle: the sound goes off at once, not after a confirmation.
Tags
- toggle
- mute
- icon-state
- audio
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
Loading…