Button Card
A large tappable card that runs one action: settings shortcuts, onboarding choices and dashboard actions. Its headline is its name for screen readers.
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 button-cardAlso works with shadcn:
npx shadcn@latest add @ritla/button-cardDependencies it brings
@base-ui/react@phosphor-icons/reactOr 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 { BellIcon } from "@phosphor-icons/react/ssr";import { ButtonCard } from "@/components/ui/button-card";<ButtonCard iconLeading={BellIcon} headline="Notifications" supportingText="Email, push and SMS" onClick={openNotifications}/>Examples
Card types
horizontal (default) with a caret at the inline end, vertical centered, vertical-wide from the inline start, and big-wide with a 3:1 illustration band, then the logo, the text and an arrow at the foot. The width comes from the layout.
Onboarding choices
Vertical cards for parallel choices; each runs one action and moves to the next step. Press one.
Dashboard actions
big-wide cards with an illustration and a logo at the top of the body. Amounts and counts follow the numerals setting; the arrow flips in Arabic, the logo doesn't.
Links and disabled
A card that navigates is a link: pass render={<a href=… />}. disabled switches it off; say why in the supporting text.
Tile
variant="tile" is an entry tile inside a TileGroup: no border or radius (the group draws the rules), a headline, a line of supporting text and an arrow at the start of its foot that nudges toward the destination on hover or focus. On the sky band it tints on hover and deeper when pressed.
Tile on every card type
variant="tile" works with every cardType: the same layout without border, radius or fill, to sit in a ruled grid. Without a cardType it is the vertical entry tile.
API reference
ButtonCard
Any other Base UI Button prop passes through (onClick, type…).
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "tile" | "default" | Figma's Style: tile is an entry tile for a TileGroup. |
cardType | "horizontal" | "vertical" | "vertical-wide" | "big-wide" | "horizontal" | Figma's Card type. On tile the default is vertical, the entry tile. |
headline | ReactNode | None | Required. Figma's Headline, and the card's name for screen readers. |
overline | ReactNode | None | Figma's Overline: a small line above the headline, shown when set. |
supportingText | ReactNode | None | Figma's Supporting text: the description screen readers read after the name. |
iconLeading | IconComponent | None | Figma's Icon leading. Not on big-wide or the entry tile, as in Figma. |
iconTrailing | IconComponent | null | CaretRightIcon / ArrowRightIcon | Figma's Icon trailing: the trailing arrow; flips in Arabic. null hides it. |
illustration | ReactNode | None | Figma's Illustration on big-wide: fills a 3:1 band above the text, and never mirrors. |
logo | ReactNode | None | Figma's Logo on big-wide: a mark at the top of the body. Never mirrors. |
disabled | boolean | false | State = Disabled. |
render | ReactElement | None | A link with the card's look (<a> or <Link>); it keeps its semantics. |
className | string | None | Extra classes, such as a width (w-space-160). |
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 |
|---|---|
| Tab | Moves focus to the card and shows the ring around it. |
| EnterSpace | Runs the action (Enter only for a link card). |
ARIA
- A native button (or link with
render);aria-labelledbypoints at the headline so the name stays short, andaria-describedbyat the overline and supporting text. - Icons and the logo are decorative inside the card; pass
label={null}to the logo. - One card, one action: don't nest buttons or links inside it.
Arabic and RTL notes
Mirrors
- The whole card mirrors: the icon at the inline start (the right), the arrow at the end (the left), and text starting from the right.
CaretRightandArrowRightflip through<Icon>, so they point forward in both languages.
Does not mirror
- Logos never mirror, nor do non-directional icons (bell, gear).
- Numerals
- Amounts and counts in the texts (“Pay 3 bills”) are formatted with
formatNumberand follow the numerals setting. - Arabic typography
- Overline
label-12, headlinebody-16Medium, supporting textbody-12. The card grows with its text, so Arabic never clips. - Mixed-direction text
- A currency or Latin name inside Arabic text (“1840 ريال”, “عبر Apple Pay”) renders correctly; identifiers go in
<bdi dir="ltr">.
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