Sajari UI

DatePicker

DatePicker component is a date input with a calendar popover below.

Import

Usage

Here's a basic usage of the DatePicker component.

Editable Example

Sizes

Editable Example

Format

Format of the string is based on Unicode Technical Standard #35.

Editable Example

Without time

Editable Example

Disabled date

Editable Example

Don't show input

Editable Example

Props

The DatePicker component composes PseudoBox so you can pass all PseudoBox props, and React.InputHTMLAttributes.

NameTypeDefaultDescription
dateDaterequiredA state to control date of the DatePicker.
setDatefunctionrequiredA function that receives the updated date, used to update your state.
formatDatestringThe format of the display date.
includeTimebooleantrueShow time in the calendar.
disabledDatefunctionSpecify the date that cannot be selected.
placeholderstringThe placeholder for the inner input field.
size"sm", "md""md"The size of the input field and the calendar.
placementPopperJS.Placement"bottom"The placement of the calendar dropdown.