Switch
Master Group Switch
A group of switches with a shared "turn on all" master toggle: it sits in an indeterminate position when only part of the rows are on and reports the count in words.
What you can change
- the section title through legend and the master caption through masterLabel
- the rows, captions and initial states through items
- the counter through statusText: {on} and {total} are filled with numbers
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/switch-012?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
A client component: useState holds the set of enabled ids, and a useRef with a useEffect sets the indeterminate DOM property on the master switch — React does not pass it through props. allOn and someOn are recomputed from items on every render, so the master switch cannot drift from the rows. The textual "N of M on" status duplicates the state in words, because a tri-state is not described by ARIA for the switch role. The palette lives in --vibeui-switch-012-*.
Tags
- switch
- group
- master
- indeterminate
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
Loading…