# Date Input (`<z-input-date>`)

> Date picker combining a trigger button with the calendar dropdown, optional time selection, and formatted display values.

- **Kind:** hwc
- **Category:** inputs
- **Inherits:** `BaseCalendarMixin`, `DropdownMixin`, `InputMixin`, `Hwc`, `Base`

## Attributes

| Attribute | Type | Default | From | Description |
| --- | --- | --- | --- | --- |
| `display-format` | `string` | `'MMMM DD, YYYY'` | — | Display format for the trigger text (default `MMMM DD, YYYY`); the submitted value stays ISO. |
| `with-time` | `boolean` | `false` | — | Adds time selection below the calendar. |
| `clock` | `'12h' \| '24h'` | `'12h'` | — | Time notation when `with-time` is set: `12h` (default) or `24h`. |
| `require-time` | `boolean` | `false` | — | Requires a time before the value commits (with `with-time`). |

### Inherited from `BaseCalendarMixin`

| Attribute | Type | Default | From | Description |
| --- | --- | --- | --- | --- |
| `today` | `boolean` | `false` | `BaseCalendarMixin` | Selects today's date on initialization when no `value` is given. |
| `jumpable` | `boolean` | `false` | `BaseCalendarMixin` | Replaces the prev/next month buttons with a month select and a four-digit year input, each with its own stepper buttons. |
| `starts-with` | `number` | `0` | `BaseCalendarMixin` | First day of the week, from 0 (Sunday) to 6 (Saturday). |
| `disabled-dates` | `string` | `''` | `BaseCalendarMixin` | Comma-separated ISO dates (YYYY-MM-DD) that cannot be selected. |
| `marked-dates` | `string` | `''` | `BaseCalendarMixin` | Comma-separated ISO dates (YYYY-MM-DD) rendered with an indicator dot. |
| `view-date` | `string` | `new Date().toISOString().split('T')[0]` | `BaseCalendarMixin` | ISO date (YYYY-MM-DD) whose month is displayed; defaults to today in UTC. |
| `min` | `string` | `''` | `BaseCalendarMixin` | Earliest selectable date (ISO, inclusive). |
| `max` | `string` | `''` | `BaseCalendarMixin` | Latest selectable date (ISO, inclusive). |
| `weekday-format` | `'long' \| 'short' \| 'narrow'` | `'short'` | `BaseCalendarMixin` | Length of the weekday names in the header: `long`, `short`, or `narrow`. |
| `lang` | `string` | `'en-us'` | `BaseCalendarMixin` | BCP-47 locale for month names, weekday names, and day labels. |

### Inherited from `InputMixin`

| Attribute | Type | Default | From | Description |
| --- | --- | --- | --- | --- |
| `disabled` | `boolean` | `false` | `InputMixin` | Disables the control so it cannot be interacted with. |
| `form` | `string` | `''` | `InputMixin` | Associates the hidden form input with a form by id, even when the component sits outside that form. |
| `name` | `string` | `''` | `InputMixin` | Field name for the hidden form input; array values submit as `name[]`. |
| `placeholder` | `string` | `''` | `InputMixin` | Placeholder text for the control's empty state. |
| `required` | `boolean` | `false` | `InputMixin` | Marks the control as required. |
| `value` | `string` | `''` | `InputMixin` | Initial value of the control, synchronized with the hidden form input. |

### Inherited from `Hwc`

| Attribute | Type | Default | From | Description |
| --- | --- | --- | --- | --- |
| `i18n` | `string` | `''` | `Hwc` | Per-instance text overrides as `key: text` pairs, merged over the global `z-i18n` script and the built-in defaults. |
| `floating` | `string` | `''` | `Hwc` | Floating UI placement options (for example `offset` and `shiftPadding`) parsed as `key: value` pairs. |
| `force-prevent-rerender` | `boolean` | `false` | `Hwc` | Skips re-rendering after the first render; an existing `data-host-inner` child is adopted as the rendered DOM. |
| `template` | `string` | `''` | `Hwc` | Selector or id of an external element or `<template>` whose inner content is cloned in place of an inline `template[data-fn="template"]` child. |

### Inherited from `Base`

| Attribute | Type | Default | From | Description |
| --- | --- | --- | --- | --- |
| `cls` | `string` | `''` | `Base` | Adds classes to named parts as `key: classes` pairs; a plain string targets the default part. |
| `stl` | `string` | `''` | `Base` | Adds inline styles to named parts as `key: styles` pairs; a plain string targets the default part. |

## Styling Parts (`cls` / `stl`)

Default `cls` target: `button`. Default `stl` target: `button`.

| Key | Default class | cls | stl | Description |
| --- | --- | --- | --- | --- |
| `button` | — | ✓ | — | The trigger button showing the formatted date. |
| `button-text` | — | ✓ | ✓ | Text span inside the trigger. |
| `calendar` | — | ✓ | ✓ | The calendar grid inside the dropdown. |
| `dropdown` | `z-dropdown z-datepicker-dropdown` | ✓ | ✓ | The floating picker panel (default `z-dropdown z-datepicker-dropdown`). |
| `host-inner` | — | ✓ | — | Rendered root wrapper. |
| `icon` | — | ✓ | ✓ | Trigger icon slot (calendar icon). |
| `time` | — | ✓ | ✓ | The time input inside the time section. |
| `time-wrapper` | `z-datepicker-time` | ✓ | ✓ | Time selection section (default `z-datepicker-time`). |

## Reference inventories

- [CSS Variables (1)](https://next.0build.dev/docs/components/input-date/css-vars.md)
- [CSS Classes (2)](https://next.0build.dev/docs/components/input-date/css-classes.md)
- [Accessibility (8 ARIA parts)](https://next.0build.dev/docs/components/input-date/accessibility.md)

## i18n Keys

| Key | Default | Description |
| --- | --- | --- |
| `button-label` | `Select date` | Accessible label of the trigger button. |
| `dialog-label` | `Date picker` | Accessible label of the picker dropdown. |
| `placeholder` | `Select a date` | Trigger text when no date is selected. |
| `placeholder-with-time` | `Select a date and time` | Trigger text when no date/time is selected and `with-time` is set. |
| `selected` | `selected` | Suffix announced for the selected day. |

## Icon Keys

| Key | Used in | Description |
| --- | --- | --- |
| `calendar` | `icon` | Default trigger icon. |

## Events

| Event | Cancelable | Detail | Description |
| --- | --- | --- | --- |
| `z-input-date:change` | — | `{ value: string \| string[] }` | Fires when the committed date/time changes; `detail.value` carries the ISO value. |

## Data Hooks

| Attribute | Values | Applies to | Role | Description |
| --- | --- | --- | --- | --- |
| `data-host-inner` | — | `descendant` | `config` | Marks the rendered inner wrapper so `force-prevent-rerender` can adopt server-rendered DOM without re-rendering. |
| `data-part` | `dropdown` | `descendant` | `marker` | Marks the dropdown panel in adopted server-rendered DOM (`data-part="dropdown"`). |
| `data-reactive` | — | `descendant` | `config` | Opts the marked child (config script, data source, icons, or template) into live re-parsing when its DOM mutates. |

## Child Content

- `<script data-fn="config">` — JSON configuration script parsed by the base class (i18n, cls, stl, floating).

  | Attribute | Required | Type | Description |
  | --- | --- | --- | --- |
  | `data-fn` | ✓ | `config` | Marks the script as configuration (value: `config`). |
  | `data-reactive` | — | `boolean` | Re-parses the configuration when the script mutates. |

- `<select data-fn="data-source">` — Hidden select parsed into grouped option data by the base class.

  | Attribute | Required | Type | Description |
  | --- | --- | --- | --- |
  | `data-fn` | ✓ | `data-source` | Marks the select as the data source (value: `data-source`). |
  | `data-reactive` | — | `boolean` | Re-parses the options when the select mutates. |

  - `<optgroup>` — Groups options under a label.

    | Attribute | Required | Type | Description |
    | --- | --- | --- | --- |
    | `label` | ✓ | `string` | Group header text; also the default group key. |
    | `disabled` | — | `boolean` | Disables every option in the group. |
    | `data-key` | — | `string` | Overrides the group key used in the parsed data. |
    | `data-keywords` | — | `comma-separated string` | Comma-separated keywords stored with the group's data. |

    - `<option>` — One option entry within the group.

      | Attribute | Required | Type | Description |
      | --- | --- | --- | --- |
      | `value` | — | `string` | Value carried by this option in the parsed data. |
      | `disabled` | — | `boolean` | Makes the option non-selectable. |
      | `selected` | — | `boolean` | Marks the option as initially selected. |
      | `data-keywords` | — | `comma-separated string` | Extra search terms, comma-separated; searched alongside the label and value. |

  - `<option>` — One ungrouped option entry.

    | Attribute | Required | Type | Description |
    | --- | --- | --- | --- |
    | `value` | — | `string` | Value carried by this option in the parsed data. |
    | `disabled` | — | `boolean` | Makes the option non-selectable. |
    | `selected` | — | `boolean` | Marks the option as initially selected. |
    | `data-keywords` | — | `comma-separated string` | Extra search terms, comma-separated. |

- `<template data-fn="icons">` — Instance-level icon repository.

  | Attribute | Required | Type | Description |
  | --- | --- | --- | --- |
  | `data-fn` | ✓ | `icons` | Marks the template as an icon source (value: `icons`). |
  | `data-reactive` | — | `boolean` | Re-parses the icons when the template mutates. |

  - `<*>` — One icon element.

    | Attribute | Required | Type | Description |
    | --- | --- | --- | --- |
    | `data-key` | ✓ | `string` | Icon key referenced by `$icons`. |

- `<template data-fn="template">` — Deferred content template mounted by the base class.

  | Attribute | Required | Type | Description |
  | --- | --- | --- | --- |
  | `data-fn` | ✓ | `template` | Marks the template for deferred mounting (value: `template`). |
  | `data-reactive` | — | `boolean` | Re-parses the template when it mutates. |

## Keyboard

| Keys | Action | When |
| --- | --- | --- |
| `Escape` | Closes the picker dropdown. | — |

## Notes

- Calendar attributes (`min`, `max`, `disabled-dates`, `marked-dates`, `jumpable`, `lang`, …) apply here through the shared calendar base.
- The dropdown positions with Floating UI; `floating` tunes offset/shift.

## Guides

- [Styling with cls and stl](https://next.0build.dev/docs/guides/styling.md)
- [Translating Components](https://next.0build.dev/docs/guides/i18n.md)
- [Icon Resolution](https://next.0build.dev/docs/guides/icons.md)
- [The data-source Convention](https://next.0build.dev/docs/guides/data-source.md)
- [Openers & Triggers](https://next.0build.dev/docs/guides/triggers.md)
- [Dialog Behavior](https://next.0build.dev/docs/guides/dialogs.md)
- [Utilities](https://next.0build.dev/docs/guides/utilities.md)
- [Runtime](https://next.0build.dev/docs/guides/runtime.md)

## Related

- [Calendar](https://next.0build.dev/docs/components/calendar.md)
- [Time Input](https://next.0build.dev/docs/components/input-time.md)
