Checkbox Card
A list row chosen with a checkbox, with an icon or picture at the start, a headline and supporting text. The whole row is clickable.
Ritla scan of this preview: 41 of 41 checks3 breakpointsScanned
Preview
Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.
Installation
Add the component
npx ritla add checkbox-cardAlso works with shadcn:
npx shadcn@latest add @ritla/checkbox-cardOr copy by hand
Installing by hand copies the component's source into your project. The source comes with a Ritla UI license, so the CLI is the short way to the same files.
Usage
import { CheckboxCard } from "@/components/ui/checkbox-card";<CheckboxCard leading={CreditCardIcon} description="Ending 4242" trailingText="SAR 2,450">Everyday card</CheckboxCard>Examples
Box at the start, disabled
leading="checkbox" puts the box at the start; disabled grays out the whole row.
API reference
CheckboxCard
Also takes Checkbox's value and state props.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | None | Figma's Headline. |
overline / description / trailingText | ReactNode | None | Figma's Overline, Supporting text and Trailing text. |
leading | IconComponent | ReactNode | "checkbox" | None | Figma's Leading type: an icon, a node (avatar or image), or checkbox to put the box at the start. |
Accessibility
Keyboard
Keys are written for left-to-right. In right-to-left the arrow keys swap: the one pointing toward the reading direction moves forward.
| Key | Action |
|---|---|
| TabSpace | Tab to the box; Space toggles. |
ARIA
- The box is named by the headline and linked to the supporting text; the whole row is a
<label>. - Focus tints the row and shows the focus ring around the box.
Arabic and RTL notes
Mirrors
- The icon sits at the start (the right), the box at the end (the left).
Does not mirror
- Non-directional icons and the check don't mirror.
- Numerals
- Amounts in the trailing text follow
numeralsthroughformatNumber. - Arabic typography
- The headline is
body-16Medium; the overline and trailing text arelabel-12(14px under Arabic), the supporting textbody-12(also 14px under Arabic).
Checks it passes
The Ritla checks this component satisfies by construction. Used as documented, it does not bring these defects onto your page.
- Arabic text falling back past the declared font family (measured, declared, or a webfont that failed to load)
- letter-spacing applied to Arabic text (breaks the connected script)
- Clipped text: content wider than its box with overflow hidden and no ellipsis
- Fixed-pixel-width container whose Arabic text exceeds the space