CardHeader
Card header section rendering title, subtitle and optional prepend/append icon or avatar in a 3-column grid layout.
Preview
Rendering the live preview…
title onlyRendering the live preview…
with subtitleRendering the live preview…
with prepend iconRendering the live preview…
with append iconStructure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<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
All props accepted by this component, with their type, default value and 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
Content slots exposed by this component.
- #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
Events emitted by this component.
- @click:appendMouseEvent
- Fired when the user clicks the append slot area.
- @click:prependMouseEvent
- Fired when the user clicks the prepend slot area.
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 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.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- 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
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
Keyboard interactions
| Key | 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.
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 header
With prepend icon and append action
With avatar
Ecosystem
Family
Components from the same folder that share conventions and often compose together.