CardHeader
Card header section rendering title, subtitle and optional prepend/append icon or avatar in a 3-column grid layout.
Aperçu
Rendu de l’aperçu en cours…
title onlyRendu de l’aperçu en cours…
with subtitleRendu de l’aperçu en cours…
with prepend iconRendu de l’aperçu en cours…
with append iconStructure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<origam-card-header> — root grid ① (3-column: prepend / content / append), underlay ② (absolute), prepend ③, content area ④, title ⑤, subtitle ⑥.- 1.origam-card-header
- Root element (renders as OrigamToolbar). 3-column grid:
max-content 1fr auto. Overrides toolbar box-shadow and background to be transparent/none to match the card surface. - 2.origam-card-header__underlay
- Absolute positioned underlay span. Reserved for interaction overlays (position: absolute, inset: 0).
- 3.origam-card-header__prepend
- Prepend column host (grid-area: prepend). Display: flex, align-items: center. Renders prependAvatar, prependIcon or #prepend slot.
- 4.origam-card-header__content
- Content column host (grid-area: content). overflow: hidden. Contains title, subtitle and the #default slot.
- 5.origam-card-header__title
- Title text block. font-size: 1rem, font-weight: 400, white-space: nowrap, overflow: hidden, text-overflow: ellipsis.
- 6.origam-card-header__subtitle
- Subtitle text block. opacity: 0.6, font-size: 0.875rem. Line-clamped via -webkit-box-orient: vertical.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- subtitlestring | number
- Secondary text rendered below the title. Slightly smaller and at reduced opacity (0.6). Can be overridden with the #subtitle slot.
- titlestring | number
- Primary heading text rendered in the content area. Can also be overridden with the #title slot.
- titleIdstring
- tagstring'OrigamToolbar'
- Root element tag. Defaults to OrigamToolbar so it picks up toolbar-level layout; overrides box-shadow and background to integrate into the card surface.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>false
- Applies a border to the header element. Sets border-width: thin when true.
- 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
- Border-radius for the header element.
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | 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
- 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
- Density modifier that adjusts padding block and inline values via --origam-card-header---density.
- appendAvatarstring
- Image URL for an OrigamAvatar rendered in the append slot.
- appendIcon
- MDI icon displayed in the append column (grid-area: append).
- prependAvatarstring
- Image URL for an OrigamAvatar rendered in the prepend slot.
- prependIcon
- MDI icon displayed in the prepend column (grid-area: prepend).
- prependAriaLabelstring
- appendAriaLabelstring
- fontSizeTFontSize
- fontWeightTFontWeight
- lineHeightTLineHeight
- letterSpacingTLetterSpacing
API
Slots
Emplacements de contenu exposés par ce composant.
- #wrapper
- Full override of the header inner layout (prepend + content + append). When provided, all other slots and prop-driven rendering are bypassed.
- #title
- Override the title content. Receives the title prop value.
- #subtitle
- Override the subtitle content. Receives the subtitle prop value.
- #default
- Extra content rendered inside .origam-card-header__content after the title and subtitle.
- #prepend
- Replaces the prepend column content. Rendered inside .origam-card-header__prepend.
- #append
- Replaces the append column content. Rendered inside .origam-card-header__append.
API
Emits
Événements émis par ce composant.
- @click:appendMouseEvent
- Fired when the user clicks the append slot area.
- @click:prependMouseEvent
- Fired when the user clicks the prepend slot area.
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 from the computed cardHeaderStyles.
- string
- Unique style-sheet ID for this instance.
- () => void
- Injects the computed style sheet into the document.
- () => void
- Removes the injected style sheet.
- Ref<boolean>
- True once the style sheet has been injected into the DOM.
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.
- Minimum height of the header. Adjusted with density offset.
- Block-start padding (density-adjusted at render time).
- Block-end padding (density-adjusted).
- Inline-start padding (density-adjusted).
- Inline-end padding (density-adjusted).
- Density offset added to padding values. compact: −8px, default: 0px, comfortable: +8px.
- Grid layout areas: prepend / content / append.
- Grid columns: prepend (shrink-to-content) / content (fill) / append (auto).
- Title font size (1rem = 16px).
- Subtitle font size (0.875rem = 14px).
- Subtitle opacity (reduced to create visual hierarchy).
- Opacity applied to icons in the prepend/append areas.
Inclusion
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Interactions clavier
| Touche | Action |
|---|---|
| Tab | Moves focus to interactive elements inside the header (prepend/append clicks). |
Notes
- The title prop is rendered as plain text in a <div>. If the card header serves as a section heading, wrap the title slot content in the appropriate heading element (<h2>, <h3>, etc.) for correct document outline.
- When appendIcon is an action (e.g. a menu trigger), add aria-label via the #append slot or on the wrapping element to describe the action to screen reader users.
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 header
With prepend icon and append action
With avatar
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.