DateField
Form-first locale-aware segmented date input
05 08 2026
Accessibility
- Pair the control with a visible label or aria-label and keep helper or error text programmatically associated.
- Provide native name, autocomplete, and value wiring when the component participates in form submission.
Styled quick start
Copy this entrypoint first. It includes the imports required to get the component on screen.
svelte
<script lang="ts">
import '@dryui/ui/themes/default.css';
import '@dryui/ui/themes/dark.css';
import { DateField } from '@dryui/ui';
</script>
<DateField.Root bind:value={departureDate} name="departureDate">
<DateField.Segment type="month" />
<DateField.Separator />
<DateField.Segment type="day" />
<DateField.Separator />
<DateField.Segment type="year" />
</DateField.Root> Import options
Root package
ts
import { DateField } from '@dryui/ui' Per-component subpath
ts
import { DateField } from '@dryui/ui/date-field' API
Props, CSS variables, and the public data attributes you can target when styling.
| Prop | Type | Description | Default | Required | Bindable |
|---|---|---|---|---|---|
DateField.Root | |||||
| size | smmdlg | Size preset affecting density, spacing, or typography. | — | — | — |
| value | Date | null | Current controlled or bindable value. | — | — | ✓ |
| name | string Adds a hidden input so the selected date participates in native form submission as YYYY-MM-DD. | Field name used during native form submission. | — | — | — |
| locale | string | — | — | — | — |
| min | Date | null | Minimum allowed value. | — | — | — |
| max | Date | null | Maximum allowed value. | — | — | — |
| disabled | boolean | Prevents interaction and applies disabled styling. | — | — | — |
| children | Snippet | Content rendered inside the component. | — | ✓ | — |
DateField.Segment | |||||
| type | monthdayyear | HTML type attribute or component-specific type selector. | — | ✓ | — |
DateField.Separator | |||||
| separator | string | — | — | — | — |