Empty
.is-empty placeholder state.
Year-only field — combobox trigger with paginated year grid.
Live
<div class="ui-year">
<button type="button" class="ui-year__trigger field-control" role="combobox"
aria-haspopup="dialog" aria-expanded="false" aria-labelledby="year-label">
<span class="ui-icon ui-icon--calendar ui-year__calendar" aria-hidden="true"></span>
<span class="ui-year__value">2022</span>
<span class="ui-icon ui-icon--chevron-down ui-year__chevron" aria-hidden="true"></span>
</button>
</div>
<!-- Panel: .ui-year__panel[role=dialog] with yearbar + year cells -->
import { YearPicker } from 'caustica-design/core'
import 'caustica-design/css'
<YearPicker
value={year}
onChange={setYear}
placeholder="Choose year"
panelLabel="Choose year"
prevYearsLabel="Earlier years"
nextYearsLabel="Later years"
aria-labelledby="year-label"
/>
.is-empty placeholder state.
.is-invalid validation state.
role="dialog" with panelLabel.aria-labelledby or aria-label.prev* / next* labels).| Class | Description |
|---|---|
.ui-year / .is-open / .is-empty / .is-invalid |
Root states. |
.ui-year__trigger / __value / __calendar / __chevron |
Combobox chrome. |
.ui-year__panel / __yearbar / __year / __nav |
Year dialog. |
From src/core/YearPicker.tsx — value is a year string (e.g. "2022").
| 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. |
prevYearsLabel / nextYearsLabel |
string |
— | Page nav aria-labels (required). |