skip to the page
superthread
componentstoggle
system
superthread
version
2.15.1
date
24.11.26

toggle

a button that remembers whether it is pressed. pressed prints a foreground edge and a tick, and the words stay put.

bunx --bun shadcn@latest add @mk/toggle

example

pin an orbit run to keep it at the top. click, enter or space changes the pressed state.

light

run 024 follows the board order

dark

run 024 follows the board order

variants

default rests without a visible edge. outline keeps the input edge. each pair shows rest beside pressed.

light

default
no visible rest edge

outline
input edge at rest

dark

default
no visible rest edge

outline
input edge at rest

sizes

small, default and large match the button heights: 32, 40 and 48 px.

light

sm
32 px high

default
40 px high

lg
48 px high

icon
a square of one glyph, 32, 40 or 48 px; the edge says pressed

dark

sm
32 px high

default
40 px high

lg
48 px high

icon
a square of one glyph, 32, 40 or 48 px; the edge says pressed

states

hover changes the fill, focus draws an outside ring, and pressed holds its box. invalid uses the error edge; disabled dims the label.

light

rest
quiet outline

hover
control hover fill

focus
2 px ring, 2 px out

pressed
foreground edge, tick

invalid
error edge

disabled
faint stock, dim label

disabled, pressed
pressed box stays visible

dark

rest
quiet outline

hover
control hover fill

focus
2 px ring, 2 px out

pressed
foreground edge, tick

invalid
error edge

disabled
faint stock, dim label

disabled, pressed
pressed box stays visible