Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Card
  3. API and Development

Card

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Card, CardHeader, CardContent, CardFooter, CardControls, and ClickableCard are exported from @prepared911/ui. The docs registry records one primary component per folder; the tables below are the exact slot contracts. Use semantic Box and FlexBox props for ordinary layout, spacing, background, border, radius, overflow, and elevation. Keep Card SCSS focused on nested surfaces, bleed calculations, interaction pseudo-states, and the action overlay.
Props
NameTypeDefaultDescription
childrenReactNode—Slots, usually {@link CardHeader }, {@link CardContent } and {@link CardFooter }.
classNamestring—Classes appended after the generated classes. Put overrides in @layer chroma.overrides.
elevationCardElevationCardElevation.NoneResting shadow. A Ghost card has no shadow.
refRef<HTMLDivElement>—Ref to the card's root element.
sizeCardSizeCardSize.DefaultInterior padding.
variantCardVariantCardVariant.SurfacePainted fill and edge. No fill, edge, or shadow; the padding stays.
Storybook
Interactive examples and edge cases for this component are in Storybook.
DefaultOpens in a new tab
CardHeader
NameTypeDefaultDescription
titleLocalizedMessagerequiredVisible BodyLarge strong heading copy from formatMessage.
descriptionLocalizedMessage—Optional supporting copy.
accessoryReactNode—Non-interactive trailing visual.
controlsReactNode—Interactive right-hand group, typically CardControls. Do not compose under ClickableCard.
headingLevelHeadingLevel`HeadingLevel.H3`Semantic heading rank without changing the fixed title typography.
CardControls
NameTypeDefaultDescription
segmentsCardControlsSegment[]requiredVisible mutually exclusive segments. Development warns above three.
valuestringrequiredSelected value across segments and overflow radios.
onValueChange(value: string) => voidrequiredFired from a segment or overflow radio.
sizeSegmentedControlSize`Small`Segment height. Small matches the 24px frames.
menuLabelLocalizedMessage—Required when the kebab menu is present.
overflowItemsCardControlsOverflowItem[]—Extra ranges rendered as MenuItemRadio.
menuItemsReactNode—Extra menu content after overflow radios.
The kebab is a sibling of SegmentedControl, not a child. Additional ranges stay single-valued through radioValue / onRadioValueChange. An overflow selection clears the visible segment indicator so the group does not look fully selected.
CardContent
NameTypeDefaultDescription
childrenReactNoderequiredBody. Ordinary Card may include Scrollable, tables, or named charts. Card fills a parent-set block size so this slot can shrink.
bleedboolean`false`Flush the content against the card's inline edges. Use for charts.
CardFooter
NameTypeDefaultDescription
childrenReactNoderequiredFooter content.
justifyCardFooterJustify`Start`Start, Center, or End.
ClickableCard
Action and navigation are a discriminated union. Both require aria-label: LocalizedMessage. controls is forbidden. The action target is a sibling overlay (.pr-card__action), not a wrapper around header, content, or footer.
NameTypeDefaultDescription
Action`onClick` required—Forbidden: href, external, controls.
Navigation`href` required—Forbidden: onClick, disabled, aria-pressed, controls.
external is navigation-only. It emits target="_blank" and rel="noopener noreferrer". Public target and rel props do not exist. Omitted aria-pressed produces no attribute. false and true emit those values.
Surface and Ghost
Header controls
Chart card composition
Not a component. Ordinary Card with header controls and bled chart content. Live Chart.js demos live on the visualization charts page.
Table card composition
Not a component. Ordinary Card with header controls, a table body, and a centered footer action.
Clickable action
Scrollable ordinary Card
The parent sets block size. Card fills that height. CardContent shrinks. Scrollable owns the viewport.
Previous
Card / Usage
Next
Card / Accessibility
On this page
Props
Storybook
CardHeader
CardControls
CardContent
CardFooter
ClickableCard
Surface and Ghost
Header controls
Chart card composition
Table card composition
Clickable action
Scrollable ordinary Card