form-field — wyrd.component.date-time-picker

DateTimePicker

Form field for choosing a calendar date, datetime, or range through locale-ordered segmented entry, a calendar surface, and expression-based presets, with all values carried as zoneless ISO-8601 strings.

Install @wyrd-company/react or the Flutter package and use it directly — your DESIGN.md does the styling.

01

Examples

Generated from the contract's examples block. Previews are the published @wyrd-company/react component, themed by the brand's role tokens — flip the site's light/dark toggle and they follow.

Code target Applies to every example on component pages.
empty state: closed
Usage
import { WyrdDateTimePicker } from "@wyrd-company/react";

<WyrdDateTimePicker referenceDate="2026-07-09" label="Date" description="Pick the due date." />

// events: onValueChange, onOpenChange
selected state: closed
Usage
import { WyrdDateTimePicker } from "@wyrd-company/react";

<WyrdDateTimePicker defaultValue="2026-07-09" min="2026-07-01" max="2026-07-31" referenceDate="2026-07-09" label="Date" />

// events: onValueChange, onOpenChange
open-range state: open
Usage
import { WyrdDateTimePicker } from "@wyrd-company/react";

<WyrdDateTimePicker selectionMode="range" defaultValue="2026-07-01/2026-07-07" defaultOpen visibleMonths={2} maxSpan="P30D" referenceDate="2026-07-09" presets={[{"template":"today"},{"template":"last-n-days","n":7},{"template":"last-n-days","n":30},{"template":"this-quarter"}]} label="Reporting period" />

// events: onValueChange, onOpenChange
datetime state: open
Usage
import { WyrdDateTimePicker } from "@wyrd-company/react";

<WyrdDateTimePicker granularity="minute" defaultValue="2026-07-09T14:30" defaultOpen minuteStep={15} referenceDate="2026-07-09" label="Appointment" />

// events: onValueChange, onOpenChange
inline-dashboard state: open
Usage
import { WyrdDateTimePicker } from "@wyrd-company/react";

<WyrdDateTimePicker display="inline" selectionMode="range" defaultValue="2026-07-01/2026-07-07" referenceDate="2026-07-09" dayMetadata={[{"date":"2026-07-02","weight":0.8,"label":"High activity"},{"date":"2026-07-04","weight":0.3,"label":"Low activity"}]} presets={[{"template":"last-n-days","n":7},{"template":"month-to-date"}]} label="Activity window" />

// events: onValueChange, onOpenChange
disabled state: disabled
Usage
import { WyrdDateTimePicker } from "@wyrd-company/react";

<WyrdDateTimePicker value="2026-07-09" isDisabled referenceDate="2026-07-09" label="Date" />

// events: onValueChange, onOpenChange
02

Properties

NameTypeDefaultSummary
value string undefined Controlled zoneless ISO-8601 value; a point in single mode ("2026-07-09", "2026-07-09T14:30") or an interval in range mode ("2026-07-01/2026-07-31"). Precision follows granularity.
default-value string undefined Initial uncontrolled ISO-8601 point or interval.
selection-mode single | range single Whether the value is a single point or a start/end interval selected in two steps.
granularity year | month | day | hour | minute day Value precision and deepest calendar surface; year and month terminate at their drill level, hour and minute add time columns.
display popover | inline | modal popover Calendar presentation; inline embeds the calendar surface permanently open, modal presents a mobile-friendly overlay.
is-open boolean false Controlled calendar visibility for popover and modal display; ignored by inline display.
default-open boolean false Initial uncontrolled calendar visibility for popover and modal display.
is-disabled boolean false Prevents opening the calendar, editing segments, and changing the value.
min string undefined Earliest selectable ISO-8601 value, inclusive, at the active granularity.
max string undefined Latest selectable ISO-8601 value, inclusive, at the active granularity.
blackout-dates array ISO-8601 dates rendered disabled and unselectable; shown, never hidden.
blackout-weekdays array ISO weekday numbers (1 = Monday) rendered disabled and unselectable in every visible week.
max-span string undefined Maximum range length as an ISO-8601 duration (for example P30D); days beyond the span disable while a range start is pending.
minute-step integer 1 Minute column increment at minute granularity.
visible-months integer 1 Number of consecutive month panes shown by the calendar surface.
reference-date string undefined ISO-8601 anchor for the today marker and preset expression resolution; hosts default it to the current date at the seam, and the runtime never reads a clock.
presets array Ordered relative-date expressions (template plus optional count) resolved and labeled by the shared runtime against reference-date; selecting one commits its resolved value.
fiscal-year-start-month integer 1 First month of the fiscal year consumed by quarter and year preset templates.
day-metadata array Per-day metadata; weight (0-1) drives built-in density shading and label augments the day's accessible name.
03

Slots & events

SlotCardinalityAcceptsSummary
label exactly-one text Visible label and accessible-name source.
description zero-or-one text Help text associated with the field.
day-cell zero-or-one component Consumer renderer for day cells receiving day context; replaces the built-in cell content while selection and disabled semantics stay component-owned.
EventPayloadSummary
value-change value, action Canonical value-change event carrying the ISO-8601 point or interval.
open-change is-open, reason Canonical calendar visibility event for popover and modal display.
04

Tokens

The contract's token bindings. Open the shared contextual sidebar from any example; primary swatches reflect the color you pick there. Error swatches show the active preset's values; editing any knob switches to custom and resets error to TWW · Ink.

BindingToken
root.gap spacing.xs
label.color color.on-surface
label.font typography.label-md
control.background color.surface
control.foreground color.on-surface
control.placeholder color.on-surface-variant
control.border-color color.outline
control.border-color-focus color.primary
control.border-width 1px
control.radius rounded.sm
control.padding-x spacing.md
control.padding-y spacing.sm
control.font typography.body-md
segment.background-focus color.primary
segment.foreground-focus color.on-primary
segment.radius rounded.sm
segment.padding-x spacing.xs
trigger.background color.primary
trigger.foreground color.on-primary
trigger.radius rounded.sm
trigger.padding-x spacing.md
trigger.padding-y spacing.sm
trigger.font typography.label-md
popup.background color.surface-container
popup.foreground color.on-surface
popup.border-color color.outline
popup.radius rounded.md
popup.shadow shadow.md
popup.padding spacing.md
popup.gap spacing.sm
calendar-header.foreground color.on-surface
calendar-header.font typography.label-md
calendar-header.gap spacing.sm
grid.gap spacing.xs
day.foreground color.on-surface
day.foreground-disabled color.on-surface-variant
day.background-selected color.primary
day.foreground-selected color.on-primary
day.background-in-range color.surface-container
day.foreground-in-range color.on-surface
day.background-today color.surface-container
day.density-tint color.primary
day.radius rounded.sm
day.padding-x spacing.sm
day.padding-y spacing.xs
time-panel.background color.surface-container
time-panel.foreground color.on-surface
time-panel.background-selected color.primary
time-panel.foreground-selected color.on-primary
time-panel.gap spacing.xs
time-panel.font typography.body-md
preset-group.gap spacing.xs
preset-group.padding spacing.sm
preset.background color.surface-container
preset.foreground color.on-surface
preset.background-selected color.primary
preset.foreground-selected color.on-primary
preset.radius rounded.sm
preset.padding-x spacing.sm
preset.padding-y spacing.xs
preset.font typography.label-md
05

States

StateSourceSummary
closed behavior-runtime Calendar surface is not visible.
open behavior-runtime Calendar surface is visible; always active under inline display.
range-start-pending behavior-runtime Range mode has a committed start awaiting an end selection.
focused behavior-runtime Segments, trigger, or calendar own focus.
blurred behavior-runtime Focus is outside the field.
disabled property Disabled state derived from is-disabled.
filled property State when value or default-value holds a point or interval.
06

Accessibility

From the contract's accessibility obligations. Role composite grid popup; Label slot provides the accessible name for the segmented control.

  • Left and Right arrows move focus between segments; typed digits fill the focused segment and auto-advance.
  • Up and Down arrows increment and decrement the focused segment within its valid range.
  • Enter and Space on the trigger open the calendar surface.
  • Arrow keys move focus by day in the grid; PageUp and PageDown move by month; Shift plus PageUp and PageDown move by year.
  • Home and End move focus to the start or end of the locale-derived week.
  • Enter selects the focused day, committing the point in single mode or the pending start and then end in range mode.
  • Arrow keys in the time columns move by minute-step and synchronize with the selected date.
  • Escape closes popover and modal surfaces without changing the value.
  • Each segment exposes spinbutton semantics with its localized name, current value, and valid range.
  • Trigger exposes expanded state while the calendar surface is visible.
  • Grid and gridcell roles expose focused, selected, in-range, and disabled states.
  • Days disabled by bounds, blackouts, or max-span remain visible and expose a localized explanation.
  • Preset shortcuts expose their runtime-resolved localized labels.
  • Values are zoneless; no timezone is announced or implied.
  • Verified under: rtl, locale, reduced-motion, cvd-deuteranopia, density-compact, text-expansion, safe-area, keyboard-inset.
07

SDUI

Status: partial. Values, constraints, presets, and day metadata serialize as plain data; the day-cell renderer slot, calendar rendering, locale-derived layout, focus movement, and keyboard navigation remain target-local.

SerializableMembers
Propertiesvalue, default-value, selection-mode, granularity, display, is-open, default-open, is-disabled, min, max, blackout-dates, blackout-weekdays, max-span, minute-step, visible-months, reference-date, presets, fiscal-year-start-month, day-metadata
Slotslabel, description
Eventsvalue-change, open-change
The Wyrding Way — a contract-first design system. © Wyrd Company