Skip to content

Card

Get Ritla UI

A bordered surface that holds one piece of content: a title, a description, a body and a footer. elevation="hard" lifts it with a hard shadow, and lift makes it rise on hover or focus.

Preview

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

PreviewCode
EnglishMirroredArabic
DesktopMobile
LTR →

Installation

  1. Add the component

    npx ritla add card

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

  2. 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

card.tsx
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card";<Card elevation="hard" lift render={<a href="/statements" />}>  <CardHeader>    <CardTitle>Statements</CardTitle>  </CardHeader>  <CardDescription>Download a month as a PDF.</CardDescription></Card>

Examples

Styles

Figma's Style: outlined with a hairline (the default), elevated with no line and shadow-elevation-md, and filled on the low surface with no line.

EnglishMirroredArabic
DesktopMobile
Get the code
LTR →

API reference

Card

Any other div prop passes through.

PropTypeDefaultDescription
variant"outlined" | "elevated" | "filled""outlined"Figma's Style: a hairline, lifted by shadow-elevation-md, or filled with the low surface.
elevation"none" | "hard""none"Figma's Elevation: hard adds a 6px hard shadow toward the inline end and down.
surface"page" | "band""page"What the card sits on: band is the sky band, where the shadow is one step darker.
liftbooleanfalseFigma's State = Hovered: rises 3px toward the inline start and up, its shadow growing to 9px and its line darkening, on hover or focus. For a card that is a link.
renderReactElementNoneAnother element with the card's look, usually a link; it keeps its own semantics.

CardTitle

PropTypeDefaultDescription
as"h2" | "h3" | "h4""h3"The heading level in the page's outline.

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
TabTo the card when it is a link.

ARIA

  • The card itself is a div with no role; its title is a real heading (h3 by default).
  • A lift card is one link: its name is all its text, so put the title first.
  • The movement on hover does not run when the reader asks for reduced motion; the shadow stays.

Arabic and RTL notes

Mirrors

  • The hard shadow falls bottom-left in Arabic, bottom-right in English.
  • When it lifts, the card moves toward the inline start: to the right in Arabic.
  • The title at the start, the action at the header's end.

Does not mirror

  • The upward movement doesn't change.
Numerals
Numbers in your content follow the numerals setting through formatNumber.
Arabic typography
Title label-16 Semibold, description body-14.
Mixed-direction text
Isolate amounts and Latin identifiers inside Arabic text.