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
.
Name | Type | Default | Description |
---|---|---|---|
date | Date | required | A state to control date of the DatePicker. |
setDate | function | required | A function that receives the updated date, used to update your state. |
formatDate | string | The format of the display date. | |
includeTime | boolean | true | Show time in the calendar. |
disabledDate | function | Specify the date that cannot be selected. | |
placeholder | string | The placeholder for the inner input field. | |
size | "sm" , "md" | "md" | The size of the input field and the calendar. |
placement | PopperJS.Placement | "bottom" | The placement of the calendar dropdown. |