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-groupexample
pick the ship that new runs open in. tab enters the group; the arrow keys move the choice and space selects it.
new runs open in orbit. use the arrow keys to choose.
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.
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
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