DatePicker

Component that lets the user select a date.

Import

JSX

Usage

JSX

Return value

(name: string, value: string) where the name is the given name of the Datepicker input and the datestring is in the format yyyy-mm-dd.

Variants

You can also add additional props to extend the functionalities of the datepicker.

Year limits

JSX

Description

Select a date for an appointment

JSX

Disabled days

JSX

Disabled input

JSX

Props

PropTypeDefaultDescription
id*stringdatepickerid of date input
name*stringdatepickername of date input
date*string""selected date
onChange*(name: string, value: string) => void-callback function that handles input change
requiredbooleantrueis the date input required or not
disabledbooleanfalsedisables/enables date input
descriptionstring""displays a description about the date input
minYearnumber-minimum years value
maxYearnumber-maximum years value
disabledDaysDate[]-days that cannot be selected
*: mandatory props