Skip to content

Button Card

Get Ritla UI

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

Open in Figma

Preview

Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.

PreviewCode
EnglishMirroredArabic
LTR →

Installation

  1. Add the component

    npx ritla add button-card

    Also works with shadcn: npx shadcn@latest add @ritla/button-card

  2. Dependencies it brings

    @base-ui/react@phosphor-icons/react

  3. Or 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

button-card.tsx
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.

EnglishMirroredArabic
LTR →

Onboarding choices

Vertical cards for parallel choices; each runs one action and moves to the next step. Press one.

EnglishMirroredArabic
LTR →

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.

EnglishMirroredArabic
LTR →

Links and disabled

A card that navigates is a link: pass render={<a href=… />}. disabled switches it off; say why in the supporting text.

EnglishMirroredArabic
LTR →

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.

EnglishMirroredArabic
LTR →

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.

EnglishMirroredArabic
LTR →

API reference

ButtonCard

Any other Base UI Button prop passes through (onClick, type…).

PropTypeDefaultDescription
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.
headlineReactNodeNoneRequired. Figma's Headline, and the card's name for screen readers.
overlineReactNodeNoneFigma's Overline: a small line above the headline, shown when set.
supportingTextReactNodeNoneFigma's Supporting text: the description screen readers read after the name.
iconLeadingIconComponentNoneFigma's Icon leading. Not on big-wide or the entry tile, as in Figma.
iconTrailingIconComponent | nullCaretRightIcon / ArrowRightIconFigma's Icon trailing: the trailing arrow; flips in Arabic. null hides it.
illustrationReactNodeNoneFigma's Illustration on big-wide: fills a 3:1 band above the text, and never mirrors.
logoReactNodeNoneFigma's Logo on big-wide: a mark at the top of the body. Never mirrors.
disabledbooleanfalseState = Disabled.
renderReactElementNoneA link with the card's look (<a> or <Link>); it keeps its semantics.
classNamestringNoneExtra 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.

KeyAction
TabMoves focus to the card and shows the ring around it.
EnterSpaceRuns the action (Enter only for a link card).

ARIA

  • A native button (or link with render); aria-labelledby points at the headline so the name stays short, and aria-describedby at 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.
  • CaretRight and ArrowRight flip 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 formatNumber and follow the numerals setting.
Arabic typography
Overline label-12, headline body-16 Medium, supporting text body-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.

  • R050Arabic text falling back past the declared font family (measured, declared, or a webfont that failed to load)
  • R051letter-spacing applied to Arabic text (breaks the connected script)
  • R042Clipped text: content wider than its box with overflow hidden and no ellipsis
  • R043Fixed-pixel-width container whose Arabic text exceeds the space