Skip to content

Container

Card

Bordered surface for grouped content.

import { Card } from '@var-ui/react';

Static card

Plain content surface.

Card

Bordered surface for grouped content.

Examples

Default

Static card

Plain content surface.
Demo.tsxTSX
import { Card } from '@var-ui/react';

<Card title="Static card">Plain content surface.</Card>

Give a Card an href and the whole card becomes one link (an <a>), the same way Button does. A link card takes a title (required), an optional description and a trailing hint (a reading time, “Learn more →”); children render between the description and the hint. Keep link cards free of other interactive content: a button or link inside a link is invalid.

Demo.tsxTSX
import { Card } from '@var-ui/react';

<Card
  href="#"
  title="Theming guide"
  description="Override any token with plain CSS custom properties."
  hint="5 min read"
/>

Description, title badge and pressable cards

Every card takes description, and titleEnd for content at the end of the title row, such as a status Badge. In Astro that’s the title-end slot. Link cards accept a node title.

onClick makes a div card pressable: the title becomes a <button> whose hit area covers the card. The card gets button semantics, focus and Enter/Space, with the title as its name, and no block content ends up inside a button. Links and buttons inside the card keep working.

TSX
<Card
  title="Memory"
  titleEnd={<Badge tone="success">Saved</Badge>}
  description="Tuesday"
  onClick={open}
/>

Props

Accessibility

Built on React Aria Components where applicable.