DatePicker & Calendar Component

A dependency-free date picker: an Input-style trigger opening a popover Calendar. The Calendar is also exported standalone for inline use.

Import

javascript
1import { DatePicker, Calendar } from "@neuctra/ui";

DatePicker — Basic Usage

No date selected

Ranges & Disabled Dates

Constrain with minDate/maxDate or an isDateDisabled callback (e.g. weekends).

Weekdays only, starting today

Inline Calendar

Use Calendar directly when the grid should always be visible.

September 2026

Props

All available props for the DatePicker & Calendar component.

PropTypeDefaultDescription
value / defaultValueDate | nullnullControlled / uncontrolled selection (both components)
onChange(date) => void—DatePicker: Date | null · Calendar: Date
placeholderstring"Pick a date"Trigger text while empty
formatDate(date: Date) => stringtoLocaleDateStringDisplay formatting
disabledbooleanfalseDisables the trigger
clearablebooleanfalseInline clear button while a date is set
calendarPropsOmit<CalendarProps, "value" | "defaultValue" | "onChange" | "className">—minDate, maxDate, isDateDisabled, weekStartsOn, locale…
label / error / helperTextstring—Standard field furniture
size"sm" | "md" | "lg""md"Trigger height
Calendar.weekStartsOn0 | 11Sunday- or Monday-first weeks
Calendar.localestringbrowserLocale for month/weekday names
wrapperClassNamestring—Styles the outermost wrapper.
labelClassNamestring—Styles the field label.
iconClassNamestring—Styles the calendar icon in the trigger.
textClassNamestring—Styles the displayed date text.
clearButtonClassNamestring—Styles the clear button.
clearIconClassNamestring—Styles the icon inside the clear button.
panelClassNamestring—Styles the popover panel containing the calendar.
helperClassNamestring—Styles the helper/error text below the trigger.
Calendar.headerClassNamestring—Styles the month header row (prev/next buttons and label).
Calendar.navButtonClassNamestring—Styles the previous/next month buttons.
Calendar.monthLabelClassNamestring—Styles the current month/year label.
Calendar.weekdaysClassNamestring—Styles the weekday header row.
Calendar.weekdayClassNamestring—Styles each weekday header cell.
Calendar.daysClassNamestring—Styles the day grid container.
Calendar.dayClassNamestring—Styles each individual day cell.

Accessibility

  • The trigger exposes aria-haspopup="dialog" / aria-expanded; the panel is a labelled dialog closed by Escape or outside click.
  • Every day button has a full-date aria-label; today is marked aria-current and the selection aria-pressed.
  • The month grid always renders six rows, so the popover height never jumps while navigating.

Frequently Asked Questions

How do I install and import the DatePicker component?

Install the @neuctra/ui package, then import it with: import { DatePicker } from "@neuctra/ui";

What variants and sizes does DatePicker support?

DatePicker supports sizes: sm, md, lg. Use the variant and size props to switch between them, or pass a className to layer on custom Tailwind CSS classes.

Is the DatePicker component accessible?

DatePicker is built with semantic HTML and standard ARIA attributes, and supports keyboard navigation and focus states out of the box, so it works well with screen readers and keyboard-only users.

Built with React, Tailwind CSS & TypeScript.