Skip to main content

Date picker

Props

NameTypeDefaultDescription
namestring-The name of the field being registered.
disablePastboolean-Disables dates in the past if set to true.
isDisabledboolean-Disables the input field when true.
maxDateDate-The maximum selectable date.
minDateDate-The minimum selectable date.
disableFutureboolean-Disables dates in the future if set to true.
disablePastboolean-Disables dates in the past if set to true.
disabledDates(day: any) => boolean-Disables dates in the past if set to true.
sxobject-Custom styles applied to the component (Material UI sx prop).
dataTestIdstring''A data-testid attribute for testing purposes.
labelstring-The label displayed for the component. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
labelConfigobject{ labelClassName: {}, labelTextClassName: {} }Configuration for customizing label styles. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
idstring-The unique identifier for the component. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
tooltipstring''Tooltip content to display additional information. If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.
dependsOnFieldobject{ fieldName: '', value: [] }Defines dependencies on another field (To show or hide this component,based on state of some field), specifying the field name and expected value(s). If component is used as a standalone component, it needs to be wrapped with withLabelAndTooltip.

Config example

const inputConfig = {
type: 'datepicker',
data: {
name: 'dob',
label: 'Date of Birth *',
disableFuture: true
}
}