Empty
.is-empty shows placeholder styling.
Day-level date field — combobox trigger with month grid calendar panel.
Live
<div class="ui-date">
<button type="button" class="ui-date__trigger field-control" role="combobox"
aria-haspopup="dialog" aria-expanded="false" aria-labelledby="date-label">
<span class="ui-icon ui-icon--calendar ui-date__calendar" aria-hidden="true"></span>
<span class="ui-date__value">Jun 15, 2024</span>
<span class="ui-icon ui-icon--chevron-down ui-date__chevron" aria-hidden="true"></span>
</button>
</div>
<!-- Panel (portaled when open): .ui-date__panel[role=dialog] with monthbar + grid -->
import { DatePicker } from 'caustica-design/core'
import 'caustica-design/css'
<DatePicker
value={date}
onChange={setDate}
placeholder="Choose date"
panelLabel="Choose date"
prevMonthLabel="Previous month"
nextMonthLabel="Next month"
clearLabel="Clear date"
aria-labelledby="date-label"
/>
.is-empty shows placeholder styling.
.is-invalid on the root.
role="dialog" with panelLabel.aria-labelledby or aria-label.prev* / next* labels).clearLabel for the clear control in the panel.| Class | Description |
|---|---|
.ui-date / .is-open / .is-empty / .is-invalid |
Root states. |
.ui-date__trigger / __value / __calendar / __chevron |
Combobox chrome. |
.ui-date__panel / __monthbar / __month / __nav |
Calendar dialog. |
.ui-date__weekdays / __grid / __cell |
Day grid. |
From src/core/DatePicker.tsx — value is a local date string (YYYY-MM-DD).
| Prop | Type | Default | Description |
|---|---|---|---|
value / onChange |
string / fn |
— | Controlled ISO-ish value (required). |
placeholder |
string |
— | Empty display text (required). |
panelLabel |
string |
— | Dialog accessible name (required). |
disabled / invalid |
boolean |
false |
Disabled / invalid states. |
aria-* |
string |
— | label, labelledby, describedby. |
prevMonthLabel / nextMonthLabel |
string |
— | Month nav aria-labels (required). |
clearLabel |
string |
— | Clear control label (required). |
monthLabels / weekdayLabels |
readonly string[] |
defaults | Optional i18n label arrays. |