skip to the page
superthread
componentsradio group
system
superthread
version
2.15.1
date
24.11.26

radio group

one choice from a named set. an 18 px square holds an 8 px foreground square when chosen.

bunx --bun shadcn@latest add @mk/radio-group

example

pick the ship that new runs open in. tab enters the group; the arrow keys move the choice and space selects it.

light

new runs open in orbit. use the arrow keys to choose.

dark

new runs open in orbit. use the arrow keys to choose.

states

each choice keeps the input edge at rest and on hover. chosen changes the edge and adds the square; keyboard focus draws outside it. invalid uses the error edge.

light

rest
18 px input box

hover
keeps its input edge

chosen
8 px foreground square

focus
2 px ring, 2 px out

invalid
error edge

disabled
faint stock

disabled, chosen
square in disabled ink

dark

rest
18 px input box

hover
keeps its input edge

chosen
8 px foreground square

focus
2 px ring, 2 px out

invalid
error edge

disabled
faint stock

disabled, chosen
square in disabled ink