Demo
Segmented date fields
Documented in DateField.
Segmented date fields
DateField in the locale's segment order and digits, a pattern format with extra paste formats, strict bounds with an error message, and a date-time field in a fixed time zone.
Start date (en-US)
11232026
Startdatum (de-DE)
23112026
تاريخ البدء (ar-EG)
٢٣١١٢٠٢٦
Pattern dd MMM yyyy
23Nov2026
Within November (strict)
mmddyyyy
Out-of-range input moves to the nearest bound on blur.Meeting (date and time)
112320260230PM
Form value of the first field: 2026-11-23
Demo.tsx
'use client';
import { useState } from 'react';
import { DateField, type FieldChangeDetails } from '@salmonui/calendars/date-picker';
/** Segmented date fields in three locales, a pattern format, a strict bounded field and a date-time field. */
export default function DateFieldDemo() {
const [iso, setIso] = useState('2026-11-23');
const onChange = (_value: unknown, details: FieldChangeDetails) => setIso(details.iso);
return (
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 24, alignItems: 'flex-start' }}>
<DateField label="Start date (en-US)" locale="en-US" defaultValue="2026-11-23" name="start" onValueChange={onChange} />
<DateField label="Startdatum (de-DE)" locale="de-DE" defaultValue="2026-11-23" />
<DateField label="تاريخ البدء (ar-EG)" locale="ar-EG" defaultValue="2026-11-23" dir="rtl" />
<DateField label="Pattern dd MMM yyyy" locale="en-GB" format="dd MMM yyyy" defaultValue="2026-11-23" inputFormats={['d MMM yyyy', 'yyyyMMdd']} />
<DateField
label="Within November (strict)"
description="Out-of-range input moves to the nearest bound on blur."
errorMessage="Choose a day in November 2026."
locale="en-US"
min="2026-11-01"
max="2026-11-30"
strict
placeholderValue="2026-11-15"
/>
<DateField label="Meeting (date and time)" locale="en-US" granularity="minute" defaultValue="2026-11-23T14:30" timeZone="Europe/Berlin" />
<p className="demo-status" aria-live="polite" style={{ flexBasis: '100%' }}>
Form value of the first field: <code>{iso || '(empty)'}</code>
</p>
</div>
);
}
Focus a segment and type digits (the field advances when a segment is
complete), press Up / Down to step, or paste 2026-12-01 or a date in the
locale's order. The first field posts its ISO value under name="start".