Toggle
A button that stays pressed: bold, pin, show grid.
Vibra transitions background, colour and shadow rather than all, and sets the sm size's label in the 13px register instead of 0.8rem; pressed is the kit's selected fill, --brand-muted, with the label in ink — not shadcn's muted plane, which measured 1.10:1 against the card and was the plane hover paints too. An unpressed toggle keeps its label in the quieter tier (muted-foreground) and the pointer gives it half the muted plane, so pressed and a hovered unpressed toggle sit 1.17:1 apart in the light and 1.21:1 in the dark (they were 1.11:1) and differ by the ink step in the label besides; a pressed toggle keeps its fill under the pointer, and a page's own hover:bg-* replaces the unpressed hover. Keyboard focus is the kit's focus-ring, the solid 2px accent outline Button and NavigationMenu wear, not shadcn's half-strength halo — and a toggle group's items, which are this toggle, carry it too.
Install
npx shadcn@latest add @vibra/toggleNeeds the @vibra registry in your components.json — set it up once.
Examples
With text
Words alone, because the words are the setting, beside the figure they change.
With icon
Icon-only toggles over a table. aria-label names each one, and a tooltip shows the same words to the pointer and the keyboard.
Pressed
A controlled toggle whose name never changes. aria-pressed carries the state, the star fills, and a status line says what it did.
Disabled, with the reason
A disabled toggle leaves the tab order, so the reason is written beside it rather than hidden in a tooltip, and describes it.
Formatting toolbar
Bold, italic, underline and strikethrough in one named multiple group. Tab enters once and the arrow keys move between them.
Filter chip
Toggles as filter chips. On, a chip takes the selected plane and a tick, and a status line gives the count and the total.