Selectable checkbox
Pick any number of options, each a card with a line of explanation and an icon.
Installation
npm i @uisatin/uiimport { SelectableCheckbox } from '@uisatin/ui/selectable-checkbox'About 16.2 kB of JavaScript, minified and gzipped, with what it imports (React aside). The stylesheet is one file for every component.
npx shadcn@latest add https://uisatin.dev/r/selectable-checkbox.jsonAdds selectable-checkbox.tsx, checkbox.tsx and selectable-card.tsx to components/ui.
First time with Satin? Set it up once, styles and fonts included, with the installation guide.
API Reference
The SelectableCheckbox component is a Checkbox inside a card that is its label, the box at the right edge. The whole card toggles it.
| Prop | Type | Default |
|---|---|---|
checked | boolean"indeterminate" | — |
defaultChecked | boolean | — |
onCheckedChange | (checked) => void | — |
title | ReactNode | — |
description | ReactNode | — |
icon | ReactNode | — |
size | "sm""md" | "md" |
disabled | boolean | false |
Accessibility
A Checkbox (role="checkbox", aria-checked) inside a card that is its label, so the whole card toggles it. The box is labelled by the card’s title and described by its description. The icon tile is hidden. For one legend over several cards, put them in a FieldGroup.
| Key | Action |
|---|---|
| Space | Checks or unchecks the focused card. |
Something wrong or missing on this page?
Report a problemSuggest an improvement