Skip to content

OrigamDatePickerHeader ​

<OrigamDatePickerHeader> is the large title row of <OrigamDatePicker> — the formatted date, optionally flanked by an icon or avatar on either side, with a transition between two consecutive values.

It renders inside <OrigamDatePicker> automatically; you use it directly only when overriding the picker's header slot.

Basic usage ​

vue
<template>
    <OrigamDatePickerHeader header="May 8, 2026" />
</template>

Props ​

Content ​

PropTypeDefaultDescription
headerstringundefinedText rendered in the content area. Ignored when the default slot is filled
transitionTTransitionPropsundefinedPassed straight to the <OrigamTransition> wrapping the content, so swapping header animates. <OrigamDatePicker> feeds it a direction-aware transition (OrigamTranslatePicker / OrigamReverseTranslatePicker)

Color ​

PropTypeDefaultDescription
colorTColorundefinedForeground only (IColorProps)

Consumed through useTextColor, applied on the root. Because neither .origam-date-picker-header nor __content / __prepend / __append declares a color of its own, the value inherits down to the text and to the icons, which paint in currentColor.

A TIntent value resolves to that intent's own hue (fgSubtle) — the shade meant for coloured text on a neutral surface, not the white-on-saturated pair. A raw CSS colour is passed through untouched.

The header owns no surface, so color paints no background. Use the parent picker's bgColor for that.

vue
<origam-date-picker-header header="May 8, 2026" color="primary"/>

Sizing ​

PropTypeDefaultDescription
densityTDensityundefined'compact' | 'default' | 'comfortable'

⚠️ density emits origam-date-picker-header--density-{value} on the root but the DS ships no rule for that class — the row's own height and padding come from the tokens below and do not change. What the prop does change is the default prepend / append content: it is forwarded to <OrigamAvatar>, which does implement the three density steps. It is also forwarded to <OrigamIcon>, which does not declare density at all, so there it only lands in $attrs. Content you supply through the prepend / append slots never receives it.

Icons and avatars ​

Each pair renders inside the matching grid area. prepend / append slot content replaces the default render entirely.

PropTypeDefaultDescription
prependIconTIconundefinedIcon rendered before the content
prependAvatarstringundefinedAvatar image URL rendered before the content
appendIconTIconundefinedIcon rendered after the content
appendAvatarstringundefinedAvatar image URL rendered after the content

Commons ​

PropTypeDefaultDescription
idstringautoForwarded to the root element and to the useStyle scope
classstring | string[] | objectundefinedAppended to the root class list
styleStyleValueundefinedAppended to the root inline style

Emits ​

EventPayloadDescription
clickMouseEvent | undefinedThe root row was activated. event is typed optional because the handler calls emits('click') without forwarding the original event — listeners receive undefined

<OrigamDatePicker> listens to it and switches back to the month view when the header is showing months or years.

useAdjacent additionally fires click:prepend and click:append when the matching side area is clicked, and turns that area into a role="button" tab stop as soon as a listener is attached. Those two are not listed in IDatePickerHeaderEmits, so TypeScript will not suggest them, but vm.emit(…) resolves the listener from the raw vnode props and they do fire.

Slots ​

SlotBindingsDescription
default—Replaces the header text. Its presence alone is enough to render the content area, even with no header
prepend—Replaces the default prepend avatar / icon
append—Replaces the default append avatar / icon

Behaviour notes ​

  • Layout. A three-column CSS grid (grid-template-areas: "prepend content append") with min-content / minmax(0, 1fr) / min-content. Content is bottom-aligned (align-items: flex-end) and the row clips overflow.
  • Accessibility. The root only becomes interactive when a click listener is actually attached: it then takes role="button" and tabindex="0", and Enter / Space fire the same click emit as the mouse (with preventDefault, so Space does not scroll). Without a listener it stays a plain <div> — no bogus button in the tab order. The detection reads vm.vnode.props as well as $attrs, because a declared emit never appears in $attrs.
  • Transitions. The content is keyed on header, so each new value is a new vnode and <OrigamTransition> can animate the swap.

Design tokens ​

TokenDefaultDescription
--origam-date-picker__header---min-height70pxRow height
--origam-date-picker__header---padding-inlinevar(--origam-space---6) var(--origam-space---3)Inline padding
--origam-date-picker__header---padding-block0 var(--origam-space---3)Block padding
--origam-date-picker__header---font-size32pxFont size of __content

Exposed instance API ​

defineExpose publishes filterProps, css, id, load, unload and isLoaded — the standard useStyle / useProps surface.

Examples ​

Clickable header with a trailing chevron ​

vue
<template>
    <OrigamDatePickerHeader
        header="May 8, 2026"
        :append-icon="MDI_ICONS.CHEVRON_DOWN"
        @click="viewMode = 'years'"
    />
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { MDI_ICONS } from '@origam/enums'

const viewMode = ref('month')
</script>

Custom content through the default slot ​

vue
<template>
    <OrigamDatePickerHeader>
        <strong>{{ start }}</strong> → <strong>{{ end }}</strong>
    </OrigamDatePickerHeader>
</template>