Card

Cards display content and actions about a single subject.

Usage

Card groups content and actions about a single subject. Import Card from @udixio/ui-react or @udixio/ui-angular. The component owns the container surface only: padding, typography, and inner layout come from your own content, passed as React children or Angular projected content.

Variants

variant selects the container treatment: outlined (default), elevated, and filled.

Outlined

Elevated

Filled

Actionable cards

A card becomes actionable in two ways, and both apply the same visual treatment: the shared state layer, a pointer cursor, and a visible focus outline.

  • href renders a native <a>. Use it for navigation tiles. Angular also exposes target and rel.
  • interactive without href renders role="button" with tabindex="0" and activates on Enter and Space, matching native button keyboard behavior. Bind the action with React onClick or Angular (click); keyboard activation goes through the same click event.

No action yet

An actionable card is a single action target. Do not nest links or buttons inside one: the nested control would be unreachable by keyboard in a predictable order and the card’s accessible name would absorb its text. Put inner controls in a non-interactive card instead, as shown below.

Composition

Card has no built-in header, media, or actions slots. Compose those regions with your own markup and other Udixio components.

Project Aurora

Last updated 2 days ago

Accessibility

A non-interactive card is a plain container: it carries no role, no tab stop, and no state layer, so assistive technology reads its content directly. An actionable card takes its accessible name from its content, so keep meaningful text inside it. Link cards rely on native anchor semantics; interactive cards expose button semantics with keyboard activation and a two-pixel focus outline.

Migration to the next major

Previous APIStable API
interactive as a visual affordanceinteractive also provides button semantics
Custom overlay link inside the cardhref on the card itself

interactive previously added the state layer and pointer cursor without any role, tab stop, or keyboard activation, which made “clickable” cards unreachable by keyboard. It now renders role="button" with tabindex="0". If you relied on the purely visual behavior and supplied your own semantics with a nested control, move that destination to href on the card, or drop interactive on the container that wraps your own interactive element.