Card

A React component in Beamline's Layout category, in the free sample.

A record or a small group of related content and actions: optional media, avatar, title, status, action, meta, free content and a Details toggle; plain or double-bezel frame.

Use it for

  • Grouping a record or a small set of related content and actions.
  • A chart, table or list with a title: the card is its one frame; put the content straight in, never another card.

Not for

  • Dense lists of records (table, data grid or item).
  • Page sections (use layout, not boxes).
  • A box inside a card: use a seam (footer, Separator) or a Bezel's inset panel instead.

Anatomy

  • frame (one m-surface rim, or a bezel shell; a size container)
  • media (flush to the frame; on top, or beside the body in a wide room)
  • avatar
  • title
  • description
  • meta
  • status (Badge; under the title below 20rem)
  • action (may wait for attention)
  • content
  • details toggle and panel
  • footer (behind a line-soft seam, same frame; nesting input for its controls)

Variants

  • frame: plain, bezel
  • layout: auto, stack, row

States

  • details closed
  • details open
  • working (aria-busy; the frame stays and the body holds a skeleton of the real shape)
  • pointed at / focus inside (an action with revealAction shows)
  • interactive: pointed at or focus inside (lit a rung, media leans in), pressed (sinks a little)

Keyboard

  • The Details toggle is a button
  • The action is reachable by Tab; with revealAction it shows while focus is in the card

Motion

Details open by height (collapsible); the chevron turns over --pui-duration-standard. A waiting action arrives at once on hover or focus and leaves over --pui-motion-out. The edge catches light as the pointer nears (the look's surface). interactive: the light arrives at once and leaves over --pui-motion-out; a press sinks the card 1.2% at once (not when an inner control is pressed); media grows 3% inside its clip over --pui-motion-in. Reduced motion keeps the light only.

Props

PropTypeDefaultDescription
frame"plain" | "bezel""plain"plain: one surface. bezel: a shell with the media set into an inset panel.
title / description / media / avatar / action / metaReactNode—title: Heading shown above the content. Defaults to no heading. description: Supporting text beneath the label or heading. Defaults to no supporting text. media: An image, chart or preview on top. avatar: An avatar or icon before the title. action: One control at the header's end: a menu, a button. meta: A short fact under the description: "72% of plan".
statusstring | { label, tone? }—A status pill: text, or { label, tone }.
details / detailsLabelReactNode / string—details: Extra detail behind a "Details" toggle. detailsLabel: Text on the details toggle. Defaults to "Details".
open / defaultOpen / onOpenChangeboolean—open: Controlled open state; omit to use defaultOpen. defaultOpen: Initial open state when uncontrolled. Defaults to false. onOpenChange: Reports open state after a change; no callback by default.
footerReactNode—Actions or a summary line at the bottom, set off by a hairline seam inside the same frame.
headingLevel2 | 3 | 4 | 5 | 6—The title's heading level, so cards nest under the page's own headings (2 directly under a page title).
layout"auto" | "stack" | "row""auto"Where media sits: on top (stack), beside the body (row), or by the room (auto: beside it from 42rem).
revealActionbooleanfalseThe action waits for attention: unseen until the card is pointed at or holds focus (always shown on touch). For grids of cards where a menu on every one is noise.
interactivebooleanfalseThe whole card opens something: it lights a rung under the pointer, presses in, and its media leans in. Put the link or button inside (a title link stretched over the card is the usual way); its focus ring marks the card.
style / refCSSProperties / native Ref—style: Inline styles on the documented visual root; no overrides by default. ref: Receives the documented native target or imperative handle; omitted by default.
classNamesCardClassNames—Classes for the named visual parts; no part overrides by default.
titleReactNode—Heading shown above the content. Defaults to no heading.
descriptionReactNode—Supporting text beneath the label or heading. Defaults to no supporting text.
mediaReactNode—An image, chart or preview on top.
actionReactNode—One control at the header's end: a menu, a button.
avatarReactNode—An avatar or icon before the title.
metaReactNode—A short fact under the description: "72% of plan".
detailsReactNode—Extra detail behind a "Details" toggle.
detailsLabelstring—Text on the details toggle. Defaults to "Details".
openboolean—Controlled open state; omit to use defaultOpen.
defaultOpenboolean—Initial open state when uncontrolled. Defaults to false.
onOpenChange((open: boolean) => void)—Reports open state after a change; no callback by default.
childrenReactNode—Free content under the header.

Built from

Used in

Dependencies

lucide-react

Import

import { Card } from "@beamline/card";

Get it

Card is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Card is included in the free MIT sample. Get Beamline · Connect your agent

More in Layout

  • Bezel: A double-bezel frame: an outer shell with a hairline, a small gap, and an inset panel with its own edge, so a preview, chart or media reads as set into…
  • Carousel: A row of slides that snap into place: swipe on touch, drag or the arrows with a mouse, ← → when focused, or the dots; optional autoplay that pauses and…
  • Resizable panels: Panes that trade space across draggable dividers; each divider is a focusable separator with arrow keys, limits, folding for collapsible panes and…
  • UI root: Makes a region of any app a Beamline root: theme, brand and direction for everything inside, and a matching layer at page level where its menus, dialogs…
  • Expandable card: A dense card that grows in place when asked: the frame resizes and the clamped preview opens into the full text.
  • Accordion: Topics that open in place, one at a time or several: FAQs and settings sections; each header is a button (with an optional fact at its end), and the…
  • Collapsible: One region that opens and closes in place from its trigger, its height animating to the content.
  • Scroll area: A native scroll region with thin overlay thumbs and edge fades that show only where more content waits; thumbs can be dragged or clicked.
  • Aspect ratio: Holds media, video and embeds at a fixed width-to-height ratio while the layout resizes.
  • Direction: Sets left-to-right or right-to-left for everything inside: text and logical spacing flip, and Radix parts read the direction for keys and placement.
  • Separator: A hairline between groups, horizontal or vertical; hidden from screen readers unless it carries meaning.

Part of Beamline UI: polished, editable React components and complete screens for custom applications. Build your own style from any look; tokens, fonts, radii, motion; not only colours.