Navigated to /docs/ui/components/date-picker

DatePicker

Date input and calendar popover composition.

Preview

A live, theme-aware example rendered with the published component.

Loading preview…

Import

Import the component from its dedicated entry point to keep the dependency and generated bundle explicit.

TSX
tsximport { DatePicker } from "@tavojs/ui/date-picker";

Normal Tavo.js applications load component styles through the Tavo.js UI plugin. If the application manages component CSS manually, also import @tavojs/ui/css/date-picker.

When to use

Use it when

Use `DatePicker` for date input with a calendar popover. For a plain native date field, use `TextInput type="date"`

Choose something else when

Avoid DatePicker when wrapping controls without labels or accessible names.

Examples

DatePicker example

TSX
tsximport { DatePicker } from "@tavojs/ui/date-picker";

export function DatePickerExample1() {
  return (
    <>
      <DatePicker name="due" value="2026-05-09" />
    </>
  );
}

Common props and defaults

PropTypeDefaultDescription
classNamestring

Optional class hook applied to the public root element owned by the component.
namestring

Configures name for this component.
valuestring

Configures value for this component.
minstring

Configures min for this component.
maxstring

Configures max for this component.
sizeSize

Configures size for this component.
yearnumber

Configures year for this component.
monthnumber

Configures month for this component.
openboolean

Configures open for this component.

Complete TypeScript API

Import from @tavojs/ui/date-picker. Published exports: DatePicker, DatePickerProps.

DatePickerProps

PropertyTypeRequiredDescription
childrenChild

No

Inherited children attribute accepted by DatePicker.

classNamestring

No

Optional class hook applied to the public root element owned by the component.

sxSx

No

Inherited sx attribute accepted by DatePicker.

idstring

No

Inherited id attribute accepted by DatePicker.

rolestring

No

Inherited role attribute accepted by DatePicker.

styleRecord<string, unknown>

No

Inherited style attribute accepted by DatePicker.

titlestring

No

Inherited title attribute accepted by DatePicker.

tabIndexnumber

No

Inherited tabIndex attribute accepted by DatePicker.

hiddenboolean

No

Inherited hidden attribute accepted by DatePicker.

disabledboolean

No

Inherited disabled attribute accepted by DatePicker.

onClickTavoEventHandler<MouseEvent>

No

Inherited onClick attribute accepted by DatePicker.

onChangeTavoEventHandler<Event>

No

Inherited onChange attribute accepted by DatePicker.

onInputTavoEventHandler<Event>

No

Inherited onInput attribute accepted by DatePicker.

onKeyDownTavoEventHandler<KeyboardEvent>

No

Inherited onKeyDown attribute accepted by DatePicker.

onFocusTavoEventHandler<FocusEvent>

No

Inherited onFocus attribute accepted by DatePicker.

onBlurTavoEventHandler<FocusEvent>

No

Inherited onBlur attribute accepted by DatePicker.

namestring

No

Configures name for this component.

valuestring

No

Configures value for this component.

minstring

No

Configures min for this component.

maxstring

No

Configures max for this component.

sizeSize

No

Configures size for this component.

yearnumber

No

Configures year for this component.

monthnumber

No

Configures month for this component.

openboolean

No

Configures open for this component.

renderCalendarWhenClosedboolean

No

Inherited renderCalendarWhenClosed attribute accepted by DatePicker.

onValueChange(value: string) => void

No

Inherited onValueChange attribute accepted by DatePicker.

State ownership and DOM target

ConcernContract
StateApplication controlled through open, value and the matching callback.
DOM targetNative input attributes target the owned form control; wrapper-specific props stay on the documented component root.

Anatomy and related components

This component exposes one public component root rather than a compound member API.

Limitations

Avoid DatePicker when wrapping controls without labels or accessible names.

Use only the documented props, entry points, and compound members. Internal DOM nesting and CSS class names can change without becoming part of the public component contract.

Accessibility

Form components pass through native attributes and should be paired with visible labels or accessible names.

  • Use Field, FormLabel, FormControlLabel, or aria-label for labeling.

  • Preserve native input semantics whenever possible.

  • Expose validation with error text and aria-invalid where relevant.

Component status

ContractCurrent value
Maturitystable
Categoryforms
Component import@tavojs/ui/date-picker
Explicit CSS import@tavojs/ui/css/date-picker
PreviewInteractive preview available on this page