component

Input Datetime

props · 38 shown · 38 total

State

  • defaultValue svelte
    Date null DateRange

    Initial uncontrolled value (used only to seed the controller).

  • boolean

    Disabled flag — blocks editing and dims the input.

  • error svelte
    InputDatetimeError null

    Surfaced error kind. Bindable.

  • boolean
    default false

    Treat an empty input as an error on blur.

  • value svelte
    Date null DateRange

    Currently selected value. `Date | null` for single inputs, `DateRange` when `range` is set. Bindable.

Appearance

  • "transparent" "surface.peak" "surface.hill" "surface.base" "surface.valley" "surface.ground"
    default "surface.ground"

    Background surface step for the field.

  • "none" "default" "bold" "muted" "accent"
    default "default"

    Resting border variant. The line always occupies its 1px of layout, so swapping its color on focus/error never shifts content.

  • "none" "default" "bold" "muted" "accent"

    Border variant applied only on hover/press, composed over `border`.

  • "primary" "secondary" "tertiary"
    default "tertiary"

    Surface emphasis ramp for the field's own panel. `tertiary` (the default) paints the neutral surface ramp regardless of `tone`; `secondary` follows the tone palette; `primary` fills with the accent surface.

  • "lg" "md" "sm" "xs" "inherit" "none" "xl" "2xl" "inner" "2xs" "3xl" "4xl" "5xl" "6xl" "full"

    Corner radius override. Without it the corner follows the size tier (`control.<size>`). `inner` renders a concentric corner computed from the nearest parent panel (parent radius − parent padding, floored at `2xs`).

  • string

    Separator joining the two range groups. Default `"–"`.

  • string

    Override the locale-derived separator between date parts.

  • "lg" "md" "sm" "xs" "none" "xl"
    default "none"

    Drop shadow for the field's surface.

  • "lg" "md" "sm" "xs"
    default md

    Visual size — drives the field height + density.

  • "primary" "inherit" "cyan" "danger" "dynamic" "mauve" "neutral" "pink" "sage" "slate" "stone" "success" "teal" "violet" "warning"
    default "neutral"

    Semantic tone palette for the field's surface. Independent of the transient `data-error` state, which always flips the field to `danger`.

  • boolean
    default false

    Blur + saturate whatever sits behind the field (for fields floating over content).

Layout

  • number
    default 1

    How many months the calendar popover shows side by side. Maps to the Calendar's `numberOfMonths` (clamped to 1–3 by the Calendar). Only applies when `calendar` is set.

  • boolean
    default true

    Whether the input stretches to fill its container. Default: true.

  • "lg" "md" "sm" "xs" "inherit" "none" "xl" "2xl" "inner" "2xs" "3xl" "4xl" "5xl" "6xl" "full"

    Border radius for the bottom-left and bottom-right corners.

  • "lg" "md" "sm" "xs" "inherit" "none" "xl" "2xl" "inner" "2xs" "3xl" "4xl" "5xl" "6xl" "full"

    Border radius for the top-left and bottom-left corners.

  • "lg" "md" "sm" "xs" "inherit" "none" "xl" "2xl" "inner" "2xs" "3xl" "4xl" "5xl" "6xl" "full"

    Border radius for the top-right and bottom-right corners.

  • "lg" "md" "sm" "xs" "inherit" "none" "xl" "2xl" "inner" "2xs" "3xl" "4xl" "5xl" "6xl" "full"

    Border radius for the top-left and top-right corners. Overrides `radius` on those corners only (flush-edge chains).

Behavior

  • boolean
    default false

    Show a trailing calendar-icon trigger that opens a date-picker popover. Only takes effect for `granularity` `"date"` / `"datetime"` (never for `"time"`). Default `false`. Opt in to add the picker to a typed field.

  • "date" "time" "datetime"
    default date

    Which units to edit. Default: `"date"`.

  • boolean

    Force 24-hour (no AM/PM) or 12-hour mode for the time portion. When omitted, the locale's default hour cycle decides.

  • string

    Locale tag driving date segment order, separators, and placeholders. For a non-English locale it also names the segments (`pt-BR` → "Ano", "Mês", "Dia") via `Intl.DisplayNames`, unless `labels` names them explicitly.

  • Date

    Latest allowed value (inclusive). Same semantics as `minValue`, at the other end of the window.

  • Date

    Earliest allowed value (inclusive). Disables earlier days in the calendar popover AND validates typed input — a complete value below it surfaces the `out-of-range` error on blur (typing itself stays free). Compared at the input's granularity: date-only by Y/M/D, datetime to the minute, time by wall-clock time-of-day.

  • string

    `name` for the hidden form input (range emits `name` + `name-end`).

  • (error: InputDatetimeError | null) => void

    Fires whenever the error transitions.

  • (value: Date | null | DateRange) => void

    Fires when the value changes.

  • boolean
    default false

    Render a start/end range (value becomes a {@link DateRange}).

Accessibility

  • string

    Accessible label for the group. Wins over `labels.date` / `labels.time` / `labels.datetime`. Default derived from granularity.

  • InputDatetimeLabels
    default English labels ("Year", "Month", "Day", "Hour", "Minute", "Day period", "Choose date", …)

    Every accessible string the field renders — segment names ("Year", "Hour", "Day period"), the field name per granularity, the range group names + how they combine with a segment name, and the calendar trigger name. Precedence per string: this prop > the `locale`-derived segment name (`Intl.DisplayNames`, non-English locales only) > the English default. Plain strings and `{placeholder}` templates survive Astro hydration.

Advanced

  • string

    Optional class string forwarded to the root element.

  • string

    id forwarded to the root element.

  • InputDatetimePassThrough<RootEl>

    Per-slot style/props passthrough.

  • boolean
    default false

    Astro / vanilla: serialize the props into `data-input-datetime-config` (on the field root) so the client runtime hydrates this instance and `getPindoba(el, "input-datetime")` can `update()` it. Frameworks with their own reactivity don't need it.

Type

  • Components
  • Blocks