When to use
Section titled “When to use”DatePicker is for a single date in a form: a start date, a due date, a birth date. Users can type the date or pick it from the calendar.
When not to use
Section titled “When not to use”- For a range: use DateRangePicker.
- For a calendar that stays open on the page: use Calendar.
- For a time: use TimeField.
Anatomy
Section titled “Anatomy”DDMMYYYY
Type the day, month and year, or pick from the calendar.
import { DatePicker, Provider } from '@bigbang/ui';
export default function Default() { return ( <Provider locale="en-GB"> <DatePicker label="Date" description="Type the day, month and year, or pick from the calendar." className="max-w-xs" /> </Provider> );}- Label: Names the group of segments.
- Segments: Day, month, year; placeholders while empty (
DD,MM,YYYY). - Calendar button: Opens the calendar popup.
- Calendar popup: The same grid as Calendar.
- Description and error: Under the field.
Behaviour
Section titled “Behaviour”- Typing digits fills a segment; when it is full, focus moves on. Typing a separator moves on too.
- Arrows step a segment up and down and wrap at the ends. Backspace clears a segment and goes back from an empty one.
- A day past the month’s last day is moved to the last day (31/02 → 28/02).
- A typed date outside
min,maxorisDateUnavailableshows a built-in message. - Picking a day closes the popup and returns focus to the calendar button.
Guidelines
Section titled “Guidelines”- Do not explain the format in the description; the placeholders show it.
- For far dates such as birth dates users type; the calendar is optional.
- State limits in text too.
Content
Section titled “Content”| Turkish | English |
|---|---|
| Takvimi aç | Open calendar |
| GG / AA / YYYY | DD / MM / YYYY |
| {min} ile {max} arasında bir tarih seçin | Choose a date from {min} to {max} |
| Bu tarih seçilemez | This date is not available |
Related components
Section titled “Related components”- Calendar: A calendar that stays open.
- DateRangePicker: A date range.
- TimeField: A time.