Card

Surface
stable

Versatile surface container with title, subtitle, image asset, text body, footer slots, link support, loading states and ripple interaction.

Preview

Rendering the live preview…

default

Rendering the live preview…

elevated

Rendering the live preview…

clickable

Rendering the live preview…

flat

Rendering the live preview…

with image

Structure

Anatomy

Visual breakdown of the component's internal structure with BEM class call-outs.

Anatomy of OrigamCardSchematic of the Card component with 8 numbered internal parts. origam-card-header: prepend / title / subtitle / append __asset (image / #asset slot) __content: origam-card-text + #default slot __footer (#footer slot) 1 2 3 4 5
Anatomy of <origam-card> — 5 visible parts: root ①, header ②, asset ③, content ④, footer ⑤. Two absolute layers (overlay for hover scrim and underlay) sit above the root.

API

Props

All props accepted by this component, with their type, default value and description.

Semantic card type hint (e.g. "article", "product", "profile"). Consumed by OrigamCardHeader for specific layout adjustments.
titleId
string
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
tag
string
'div'
HTML element rendered at the root. Becomes <a> automatically when href or to is set.
border
boolean | number | string | TDirectionBoth | Array<TDirectionBoth>
false
Applies a border to the card surface.
borderTop
boolean | number | string
borderLeft
boolean | number | string
borderBottom
boolean | number | string
borderRight
boolean | number | string
borderBlock
boolean | number | string
borderInline
boolean | number | string
borderInlineStart
boolean | number | string
borderInlineEnd
boolean | number | string
borderBlockStart
boolean | number | string
borderBlockEnd
boolean | number | string
borderColor
string
borderStyle
string
borderTopColor
TColor
borderRightColor
TColor
borderBottomColor
TColor
borderLeftColor
TColor
borderInlineStartColor
TColor
borderInlineEndColor
TColor
borderBlockStartColor
TColor
borderBlockEndColor
TColor
color
Intent or custom foreground color.
bgColor
Background color override.
density
'default'
Density modifier propagated to CardHeader and CardText.
height
number | string
Card height override.
maxHeight
number | string
maxWidth
number | string
minHeight
number | string
minWidth
number | string
width
number | string
Card width override.
elevation
TElevation
Box-shadow elevation token. Default is sm shadow.
loading
false
Shows a skeleton or progress loader overlaid on the card content. Accepts boolean, "skeleton", "line" or "circular".
loadingText
string
location
TAnchor
position
TPosition
top
number | string
bottom
number | string
left
number | string
right
number | string
Border-radius token or boolean.
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string
margin
boolean | number | string
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
padding
boolean | number | string
paddingTop
boolean | number | string
paddingLeft
boolean | number | string
paddingBottom
boolean | number | string
paddingRight
boolean | number | string
paddingBlock
boolean | number | string
paddingInline
boolean | number | string
paddingInlineStart
boolean | number | string
paddingInlineEnd
boolean | number | string
paddingBlockStart
boolean | number | string
paddingBlockEnd
boolean | number | string
href
string
Renders the card as an anchor pointing to this URL.
replace
boolean
to
RouteLocationRaw
Vue Router destination. Automatically sets tag="a" and uses router-link.
exact
boolean
ripple
boolean | { class: string }
true
Enables the Material ripple effect on click when the card is interactive.
appendAvatar
string
Avatar image URL displayed in the header append area.
appendIcon
Icon displayed in the header append area.
prependAvatar
string
Avatar image URL displayed in the header prepend area.
prependIcon
Icon displayed in the header prepend area.
prependAriaLabel
string
appendAriaLabel
string
active
boolean | IStateEffectConfig
false
Forces the active/pressed visual state (drives activeColor / activeBgColor resolution).
activeClass
string
hover
boolean | IStateEffectConfig
false
Force the hover visual state (elevated shadow + overlay tint). Used for programmatic preview.
hoverClass
string

API

Slots

Content slots exposed by this component.

#wrapper
Full override of the card inner layout (header + asset + content + footer). Advanced use only.
#loader
Override the loading state renderer (skeleton / progress bar / spinner).
#header
Override the default OrigamCardHeader. Rendered only when title, subtitle or prepend/append props are set.
#header.append
Override the append area inside the default CardHeader.
#header.prepend
Override the prepend area inside the default CardHeader.
#header.title
Override the title inside the default CardHeader.
#header.subtitle
Override the subtitle inside the default CardHeader.
#header.content
Override the full content area inside the default CardHeader.
#asset
Override the image asset area. Defaults to <origam-img cover>.
#text
Override the default OrigamCardText section.
#default
Main card content placed inside the __content div, after any header, asset and text sections.
#footer
Card footer area (typically action buttons).

API

Emits

Events emitted by this component.

@click:append
MouseEvent
Fired when the user clicks the header append area.
@click:prepend
MouseEvent
Fired when the user clicks the header prepend area.
@update:active
any
Two-way binding for the active (pressed) state.
@update:hover
boolean
@mouseenter
MouseEvent
Propagated mouseenter — triggers hover state for hoverColor / hoverBgColor.
@mouseleave
MouseEvent
Propagated mouseleave — clears hover state.

API

Exposed members

Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.

<T extends object>(props: T, exclude?: string[]) => Partial<T>
Utility to forward a filtered subset of props to child components.
Ref<string>
Reactive CSS string generated by useStyle.
string
Unique style-sheet ID for this instance.
() => void
Injects the computed style sheet.
() => void
Removes the injected style sheet.
Ref<boolean>
True once the style sheet has been injected.

Customisation

CSS variables

CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.

Card surface background.
Default text color.
Default box-shadow. Overridden to shadow.lg on hover when link=true.
Box-shadow on hover for interactive cards.
Transition duration for shadow, opacity and background.
Card opacity. Set to opacity-disabled (0.6) when disabled.
Overlay scrim opacity. Animates to overlay-opacity-hover (0.12) on hover.
Border-radius applied when rounded=true.
Density offset applied to card padding.

Inclusion

Accessibility

ARIA roles, keyboard navigation and focus management. Sourced from the real component template.

ARIA roles

article
link
button

Keyboard interactions

Keyboard interactions
KeyAction
TabMoves focus to the card when it is interactive (link=true or href/to is set).
Enter / SpaceActivates the card link or click handler when focused.

Notes

  • When disabled=true, tabindex="-1" is set to remove the card from the tab order.
  • When href or to is set, the card root renders as <a> with proper link semantics. The ripple v-ripple directive triggers on the native click event.
  • Focus-visible outline is applied via :focus-visible in the component SCSS — visible for keyboard navigation, not mouse clicks.
  • The __overlay and __underlay spans are aria-hidden (inert layers).
  • The v-contrast directive is applied to ensure accessible foreground/background contrast when color is set.
  • The OrigamProgress inside the loader slot has role="progressbar". OrigamSkeleton is aria-hidden (decorative).

Foundation

Design tokens

Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.

Source
color
var(--origam-color__surface---raised)
Card background.
shadow
var(--origam-shadow---sm)
Default elevation shadow.
shadow
var(--origam-shadow---lg)
Hover elevation shadow for interactive cards.
duration
var(--origam-motion__duration---slow)
Transition duration for shadow and opacity.
number
var(--origam-opacity---0)
Resting overlay opacity (0 = invisible).
number
var(--origam-opacity---12)
Overlay opacity on hover (12%).
number
var(--origam-opacity---60)
Card opacity when disabled.

Interactive

Playground

Edit props live and see the component update in real time. The generated code snippet updates as you change values.

Rendering the live preview…

Usage

Examples

Ready-to-paste code snippets for your templates.

Basic card

vue

Clickable card with link

vue

Loading states

vue

Ecosystem

Family

Components from the same folder that share conventions and often compose together.