05 08 2026

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, Field, Label } from '@dryui/ui';
</script>

<Field.Root>
  <Label>Departure date</Label>
  <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>
</Field.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
— — — —