Skip to content

Date Picker

DatePicker is a text field with a calendar. The header of the calendar switches between day, month and year views.

import { DatePicker, parseDate } from '@beyul/sulmu-ui'

Source · Figma

value and defaultValue are arrays of dates (one entry for a single date). Create dates with parseDate('2025-09-30'), which the library re-exports from Ark UI.

import { DatePicker, parseDate } from '@beyul/sulmu-ui'
export default function Example() {
return (
<div style={{ maxWidth: 320 }}>
<DatePicker aria-label="Closing date" defaultValue={[parseDate('2025-09-30')]} />
</div>
)
}

Inside a Field the label names the input, and an errorText marks the input invalid.

Choose a date
import { DatePicker, Field, Stack } from '@beyul/sulmu-ui'
export default function Example() {
return (
<Stack style={{ maxWidth: 320 }}>
<Field label="Closing date" required>
<DatePicker />
</Field>
<Field label="Start date" errorText="Choose a date">
<DatePicker size="lg" />
</Field>
</Stack>
)
}
PropTypeDefaultDescription
placeholderstringMM/DD/YYYYShown in the empty field. Default: "MM/DD/YYYY".
size"sm" | "md" | "lg"mdsm 34px, md 40px, lg 44px. Default: md.
invalidboolean-Marks the value as wrong. Inside a Field this is set for you.
aria-labelstring-Defines a string value that labels the current element.
defaultValueDateValue[]-The initial selected date(s) when rendered. Use when you don't need to control the selected date(s) of the date picker.
valueDateValue[]-The controlled selected date(s).
namestring-The name attribute of the input element.
maxDateValue-The maximum date that can be selected.
disabledboolean-Whether the calendar is disabled.
onValueChange((details: ValueChangeDetails) => void)-Function called when the value changes.
minDateValue-The minimum date that can be selected.

The remaining props of Ark UI’s DatePicker.Root are accepted too.

  • The date can be typed as well as picked, so the field works without the popup.
  • The calendar button is labelled “Open calendar”; the header buttons are “Previous” and “Next”.
  • Use min and max (dates from parseDate) to limit the range.
  • Give it an aria-label when it is not inside a Field.