ComponentsDisplayCard

Card

Cards group related information and actions into a scannable surface. They can remain static or become one clearly defined interactive control.

6 variantsCompound anatomyInteractiveSelectableMedia

Overview

Use a card to create a meaningful content group whose elements share one topic or task.

Content card

Live preview

Header, body, and footer establish a predictable reading and action order.

Quarterly planning

Updated 2 hours ago

Draft

Review goals, owners, and delivery risks before the planning session.

PlanningCard.tsx
tsx
import { Card, CardBody, CardFooter, CardHeader } from 'omverse-ui'
 
<Card variant="outlined">
<CardHeader title="Quarterly planning" subtitle="Updated 2 hours ago" />
<CardBody>Review goals, owners, and delivery risks.</CardBody>
<CardFooter divider>
<Button size="sm" variant="text">View plan</Button>
</CardFooter>
</Card>

Anatomy

A card surface can contain media, a header, body content, and a footer, but only the regions needed by the content should be rendered.

Media

Project title

Supporting context

Primary content
Actions
1234
  1. 1
    Media

    Optional image, illustration, or visual preview.

  2. 2
    Header

    Title, supporting context, identity, and local status.

  3. 3
    BodyRequired

    Primary information that belongs to the card.

  4. 4
    Footer

    Actions or metadata that conclude the group.

When to use

Cards work best for repeatable, self-contained content groups that benefit from visual separation.

Recommended

  • Group one coherent subject

    Keep the title, details, metadata, and actions about the same object or task.

  • Support scanning

    Use repeated card anatomy for comparable projects, people, assets, or plans.

  • Offer one whole-card action

    Use asButton when activating anywhere performs the same primary action.

When not to use

Do not add card surfaces when hierarchy, density, or semantics call for a simpler pattern.

Avoid

  • Do not card every section

    Use headings, spacing, and dividers when content already belongs to one page flow.

  • Do not use for dense comparison

    Use DataTable or List when column alignment and rapid row scanning matter.

  • Do not nest interactive cards

    A whole-card button must not contain other links, buttons, or form controls.

Variants

Choose a surface treatment from hierarchy and background needs, not decoration alone.

Surface treatments

Live preview

Elevated, filled, and outlined cover most product-interface needs.

elevated
filled
outlined
ghost
gradient

Elevated

Separates content from a flat background with depth.

Filled

Groups content with a quiet tonal surface.

Outlined

Defines a boundary without adding elevation.

Gradient and glass

Reserve expressive treatments for branded or promotional contexts.

States

Static cards do not need interaction states; interactive and selectable cards must communicate every available state.

StateTriggerVisual responseInteraction
DefaultStatic grouped contentStable surface treatmentOnly nested controls are interactive
HoverPointer enters an interactive cardSurface or elevation changesSignals the card can be activated
FocusKeyboard focuses an asButton cardVisible focus indicatorEnter or Space activates the card
PressedCard is being activatedBrief active feedbackAction has not yet completed
SelectedCard represents a chosen optionSelected ring or borderSelection may be toggled or changed
DisabledAction is unavailableUse native disabled treatment on asButtonCannot be activated

Behavior

The card’s semantics depend on whether it groups content or represents one action.

Static container

Leave as a div when the card only groups content and nested actions.

Whole-card action

Set asButton when the entire surface performs one action.

Selection

Pair selected visuals with aria-pressed or selection state in the surrounding pattern.

Responsive layout

Let cards reflow and avoid fixed heights that clip translated or enlarged content.

Accessibility

Card itself adds no landmark semantics; use meaningful headings and native controls according to the content and action model.

KeyAction
TabMoves to nested controls or to an asButton card.
EnterSpaceActivates an asButton card.
  • Use asButton for a single whole-card action.
  • Never place interactive descendants inside an asButton card.
  • Keep heading levels consistent with the page hierarchy.
  • Write useful alt text for meaningful media and empty alt text for decorative media.
  • Expose selected state programmatically.
  • Keep focus indicators visible against every variant.

Content guidelines

Card content should be concise enough to scan and complete enough to understand without guessing.

Lead with the subject

Use a specific title that distinguishes the card from nearby items.

ExampleQuarterly planning

Prioritize details

Show only information needed to identify or act on the item.

ExampleUpdated 2 hours ago

Use clear actions

Label buttons with the outcome rather than generic direction.

ExampleView plan

Keep repeated cards parallel

Use the same fields and content order across a collection.

ExampleOwner · Status · Due date

Examples

Interactive selection cards are appropriate when each card is one mutually comparable choice.

Selectable action card

Live preview

The whole surface is one button and exposes pressed state.

TemplateChoice.tsx
tsx
<Card
asButton
interactive
selected={selected}
onClick={() => setSelected(true)}
aria-pressed={selected}
>
<CardHeader title="Start from a template" />
<CardBody>Use a predefined project structure.</CardBody>
</Card>

Props / API

Card accepts native div attributes; asButton changes the rendered element to a button. Compound regions accept their matching div attributes.

Card

Props

PropTypeDefaultDescription
variant'elevated' | 'filled' | 'outlined' | 'ghost' | 'gradient' | 'glass''elevated'Sets the surface treatment.
radius'none' | 'sm' | 'md' | 'lg' | 'full''md'Sets the corner radius.
interactivebooleanfalseAdds hover, focus, and active feedback.
selectedbooleanfalseShows a selected ring or border.
asButtonbooleanfalseRenders a semantic button when the entire card is one action.

Compound components

Props

PropTypeDefaultDescription
CardMedia.srcstringundefinedImage source; omitting it renders placeholder content.
CardMedia.altstring''Alternative text for meaningful media.
CardMedia.heightnumber'100%'Media height in pixels.
CardMedia.overlaybooleanfalseAdds a contrast gradient over the image.
CardMedia.overlayContentReactNodeundefinedContent positioned over the media.
CardHeader.titleReactNodeundefinedPrimary card heading content.
CardHeader.subtitleReactNodeundefinedSecondary heading context.
CardHeader.avatarReactNodeundefinedLeading avatar or icon.
CardHeader.actionReactNodeundefinedTrailing status or local action.
CardBody.noPaddingbooleanfalseRemoves the default body padding.
CardFooter.dividerbooleanfalseAdds a separator above footer content.
CardFlip.frontReactNoderequiredContent on the initial face.
CardFlip.backReactNoderequiredContent on the reverse face.
CardFlip.heightnumber160Flip-card height in pixels.
CardFlip.direction'horizontal' | 'vertical''horizontal'Axis used for the flip transition.