Card
Versatile surface container with title, subtitle, image asset, text body, footer slots, link support, loading states and ripple interaction.
Aperçu
Rendu de l’aperçu en cours…
defaultRendu de l’aperçu en cours…
elevatedRendu de l’aperçu en cours…
clickableRendu de l’aperçu en cours…
flatRendu de l’aperçu en cours…
with imageStructure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<origam-card> — 5 visible parts: root ①, header ②, asset ③, content ④, footer ⑤. Two absolute layers (overlay for hover scrim and underlay) sit above the root.- 1.origam-card
- Root element. Defaults to
- 2.origam-card__overlay
- Absolute scrim. opacity: 0 → overlay-opacity-hover on hover when the card is clickable. Driven by --origam-card__overlay---opacity.
- 3.origam-card__header
- OrigamCardHeader. Rendered only when title, subtitle or prepend/append slots are populated.
- 4.origam-card__asset
- Image container rendered when the image prop or #asset slot is present. Contains
by default. - 5.origam-card__content
- Main content wrapper. Contains OrigamCardText (if text prop is set) and the #default slot.
- 6.origam-card__text
- OrigamCardText — density-aware padding wrapper around the text prop value.
- 7.origam-card__footer
rendered only when the #footer slot is populated. Typically contains action buttons.- 8.origam-card__loader
- Loading overlay rendered when loading prop is set. Contains skeleton, progress-linear or progress-circular.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- contentDisplayTCardContentDisplay
- disabledbooleanfalse
- Disables interaction. Sets tabindex="-1" and applies opacity-disabled styling.
- flatbooleanfalse
- Removes the default box-shadow, rendering a flat surface without elevation.
- imagestring
- Image URL rendered inside the card asset slot as <origam-img cover>. Can be overridden via the #asset slot.
- linkbooleanfalse
- Makes the card fully clickable (ripple + overlay + cursor pointer). Automatically true when href or to is set.
- subtitlestring | number
- Card subtitle rendered below the title in OrigamCardHeader.
- textstring | number
- Card body text rendered in OrigamCardText. Can be overridden via the #text slot.
- titlestring | number
- Card title rendered in OrigamCardHeader. Can be overridden via the #header.title slot.
- type
- Semantic card type hint (e.g. "article", "product", "profile"). Consumed by OrigamCardHeader for specific layout adjustments.
- titleIdstring
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- tagstring'div'
- HTML element rendered at the root. Becomes <a> automatically when href or to is set.
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>false
- Applies a border to the card surface.
- borderTopboolean | number | string
- borderLeftboolean | number | string
- borderBottomboolean | number | string
- borderRightboolean | number | string
- borderBlockboolean | number | string
- borderInlineboolean | number | string
- borderInlineStartboolean | number | string
- borderInlineEndboolean | number | string
- borderBlockStartboolean | number | string
- borderBlockEndboolean | number | string
- borderColorstring
- borderStylestring
- borderTopColorTColor
- borderRightColorTColor
- borderBottomColorTColor
- borderLeftColorTColor
- borderInlineStartColorTColor
- borderInlineEndColorTColor
- borderBlockStartColorTColor
- borderBlockEndColorTColor
- color
- Intent or custom foreground color.
- bgColor
- Background color override.
- Density modifier propagated to CardHeader and CardText.
- heightnumber | string
- Card height override.
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- Card width override.
- elevationTElevation
- Box-shadow elevation token. Default is sm shadow.
- Shows a skeleton or progress loader overlaid on the card content. Accepts boolean, "skeleton", "line" or "circular".
- loadingTextstring
- locationTAnchor
- positionTPosition
- topnumber | string
- bottomnumber | string
- leftnumber | string
- rightnumber | string
- Border-radius token or boolean.
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- paddingboolean | number | string
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- hrefstring
- Renders the card as an anchor pointing to this URL.
- replaceboolean
- toRouteLocationRaw
- Vue Router destination. Automatically sets tag="a" and uses router-link.
- exactboolean
- rippleboolean | { class: string }true
- Enables the Material ripple effect on click when the card is interactive.
- appendAvatarstring
- Avatar image URL displayed in the header append area.
- appendIcon
- Icon displayed in the header append area.
- prependAvatarstring
- Avatar image URL displayed in the header prepend area.
- prependIcon
- Icon displayed in the header prepend area.
- prependAriaLabelstring
- appendAriaLabelstring
- activeboolean | IStateEffectConfigfalse
- Forces the active/pressed visual state (drives activeColor / activeBgColor resolution).
- activeClassstring
- hoverboolean | IStateEffectConfigfalse
- Force the hover visual state (elevated shadow + overlay tint). Used for programmatic preview.
- hoverClassstring
API
Slots
Emplacements de contenu exposés par ce composant.
- #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
Événements émis par ce composant.
- @click:appendMouseEvent
- Fired when the user clicks the header append area.
- @click:prependMouseEvent
- Fired when the user clicks the header prepend area.
- @update:activeany
- Two-way binding for the active (pressed) state.
- @update:hoverboolean
- @mouseenterMouseEvent
- Propagated mouseenter — triggers hover state for hoverColor / hoverBgColor.
- @mouseleaveMouseEvent
- Propagated mouseleave — clears hover state.
API
Membres exposés
Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.
- <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.
Personnalisation
Variables CSS
Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.
- 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
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Rôles ARIA
articlelinkbuttonInteractions clavier
Interactions clavier Touche Action Tab Moves focus to the card when it is interactive (link=true or href/to is set). Enter / Space Activates 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).
Fondation
Design tokens
Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.
- colorvar(--origam-color__surface---raised)
- Card background.
- shadowvar(--origam-shadow---sm)
- Default elevation shadow.
- shadowvar(--origam-shadow---lg)
- Hover elevation shadow for interactive cards.
- durationvar(--origam-motion__duration---slow)
- Transition duration for shadow and opacity.
- numbervar(--origam-opacity---0)
- Resting overlay opacity (0 = invisible).
- numbervar(--origam-opacity---12)
- Overlay opacity on hover (12%).
- numbervar(--origam-opacity---60)
- Card opacity when disabled.
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Basic card
vue Clickable card with link
vue Loading states
vue Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.