Slab
Markup where the component goes, CSS in your stylesheet. No JavaScript.
Paste into Claude, ChatGPT or Cursor after filling in {{USER_STACK}}, {{USER_STYLING}} and {{USER_CONSTRAINTS}}. Neutral keeps the greys you see here; Match my project asks the model to map them onto your own colour tokens.
Install with shadcn
Needs a free account token. Get a token
npx shadcn@latest add @movin/radio-slabAbout this component
Payment options as white slabs with heavy black borders and hard offset shadows. The one you pick slams down onto its shadow, turns acid lime, fills its marker and stamps a tick at the end.
Triggers
- Click
- State change
- Border
Techniques
- CSS transition
- Transform only
- SVG
- Pseudo elements
Difficulty
Beginner
Accessibility
Keyboard and screen readers
Native radios in a fieldset with a visually hidden legend ("Payment method"), each inside a <label> and named by its visible text; the marker and tick are aria-hidden. The focused slab is outlined.
Reduced motion
The transitions are switched off and the slab jumps to its pressed state.
Use it in anything you build, commercial and client work included. Licence