toggle group
toggles that share a choice and, by default, a 1 px edge. the pressed item keeps all four foreground edges visible.
bunx --bun shadcn@latest add @mk/toggle-groupexample
choose one time view, or combine ship filters. arrow keys move between items; space changes the focused item.
orbit shows the day. arrow keys move between items.
ship filters allow more than one selection.
orbit shows the day. arrow keys move between items.
ship filters allow more than one selection.
variants
default and outline keep the standalone toggle looks. the group supplies the same variant to each item.
default
shared edge, pressed edge and tick
outline
shared edge, pressed edge and tick
default
shared edge, pressed edge and tick
outline
shared edge, pressed edge and tick
sizes
the group supplies the small, default or large height to all its items.
sm
32 px high
default
40 px high
lg
48 px high
sm
32 px high
default
40 px high
lg
48 px high
layout
spacing 0 joins the edges and puts focus inside. positive spacing separates the items and restores the outside ring. vertical groups join along their horizontal edges.
joined
spacing 0, shared 1 px edge
separate
spacing 3, 12 px between items
vertical
shared horizontal edges
joined
spacing 0, shared 1 px edge
separate
spacing 3, 12 px between items
vertical
shared horizontal edges
states
the selected edge rises above its neighbour. hover fills the other item, joined focus draws inside it, and disabled dims the labels.
rest and pressed
current edge rises above its neighbour
hover
control hover fill
focus, joined
house ring inside the item
invalid
error edge on the unselected item
disabled
dim labels, faint stock
rest and pressed
current edge rises above its neighbour
hover
control hover fill
focus, joined
house ring inside the item
invalid
error edge on the unselected item
disabled
dim labels, faint stock