Date Picker
Lab componentDate Picker
DatePicker
is composed of both a DateInput
and Calendar
controls, that allows users to select either a single date or a date range consisting of a start and end date, providing a flexible and intuitive way to choose dates. Currently all date based controls, need to be wrapped in a LocalizationProvider
DatePicker
provides a context to the children
contained within it and a composable API that enables you to create your own date picker controls.
Salt provides the following children
for convenience:
DatePickerOverlay
- a container component for the content of theDatePicker
overlay.
When selectionVariant
is "single":
DatePickerSingleInput
- a composableDateInput
component pre-wired to theDatePicker
selection context.DatePickerSinglePanel
- a composableCalendar
component pre-wired to theDatePicker
selection context.
A composable API enables you to use provided child components, such as DatePickerSingleInput
and DatePickerSinglePanel
.
When selectionVariant
is "range":
DatePickerRangeInput
- a composableDateInput
component pre-wired to theDatePicker
selection context.DatePickerRangePanel
- composableCalendar
components pre-wired to theDatePicker
selection context.
A composable API enables you to use provided child components, such as DatePickerRangeInput
and DatePickerRangePanel
.
You can also compose your own overlay content with the provided components.
A composable API enables you to combine the provided child components with your own.
Use a DatePicker
component when you need a visual and intuitive interface for selecting single dates or date ranges, making it ideal for financial applications, event scheduling, and project management. In contrast, use a Dropdown
when the dates are pre-determined, the selection is infrequent, or a compact interface is required, such as selecting a birth year or a specific month in a form.
To improve consistency and simplify your messaging, recommend a single acceptable date format in the form field label and helper text—preferably the one most frequently used in your application.
To import DatePicker
from the Salt lab package, use:
Name | Type | Description | Default |
---|
Name | Type | Description | Default |
---|
DatePickerSingleInput
composes a DateInputSingle
that uses the DatePicker
context for single date selection.
Name | Type | Description | Default |
---|
DatePickerRangeInput
composes a DateInputRange
that uses the DatePicker
context for date range selection.
Name | Type | Description | Default |
---|
DatePickerSinglePanel
composes a Calendar
that uses the DatePicker
context for single date selection.
Name | Type | Description | Default |
---|
DatePickerRangePanel
composes a Calendar
that uses the DatePicker
context for date range selection.
Name | Type | Description | Default |
---|
DatePickerOverlay
is the container component for the DatePicker
overlay.
Name | Type | Description | Default |
---|
DatePickerActions
provides the controls to apply or cancel a date selection.
The useDatePicker
hook provides state
and helpers
to manage the DatePicker
state.
Name | Type | Description | Default |
---|
The useDatePickerOverlay
hook provides state
and helpers
to manage the DatePickerOverlay
state.
Name | Type | Description | Default |
---|
DatePicker
provides a context to the children
contained within it and a composable API that enables you to create your own date picker controls.
Salt provides the following children
for convenience:
DatePickerOverlay
- a container component for the content of theDatePicker
overlay.
When selectionVariant
is "single":
DatePickerSingleInput
- a composableDateInput
component pre-wired to theDatePicker
selection context.DatePickerSinglePanel
- a composableCalendar
component pre-wired to theDatePicker
selection context.
A composable API enables you to use provided child components, such as DatePickerSingleInput
and DatePickerSinglePanel
.
When selectionVariant
is "range":
DatePickerRangeInput
- a composableDateInput
component pre-wired to theDatePicker
selection context.DatePickerRangePanel
- composableCalendar
components pre-wired to theDatePicker
selection context.
A composable API enables you to use provided child components, such as DatePickerRangeInput
and DatePickerRangePanel
.
You can also compose your own overlay content with the provided components.
A composable API enables you to combine the provided child components with your own.
Use a DatePicker
component when you need a visual and intuitive interface for selecting single dates or date ranges, making it ideal for financial applications, event scheduling, and project management. In contrast, use a Dropdown
when the dates are pre-determined, the selection is infrequent, or a compact interface is required, such as selecting a birth year or a specific month in a form.
To improve consistency and simplify your messaging, recommend a single acceptable date format in the form field label and helper text—preferably the one most frequently used in your application.
To import DatePicker
from the Salt lab package, use:
Name | Type | Description | Default |
---|
Name | Type | Description | Default |
---|
DatePickerSingleInput
composes a DateInputSingle
that uses the DatePicker
context for single date selection.
Name | Type | Description | Default |
---|
DatePickerRangeInput
composes a DateInputRange
that uses the DatePicker
context for date range selection.
Name | Type | Description | Default |
---|
DatePickerSinglePanel
composes a Calendar
that uses the DatePicker
context for single date selection.
Name | Type | Description | Default |
---|
DatePickerRangePanel
composes a Calendar
that uses the DatePicker
context for date range selection.
Name | Type | Description | Default |
---|
DatePickerOverlay
is the container component for the DatePicker
overlay.
Name | Type | Description | Default |
---|
DatePickerActions
provides the controls to apply or cancel a date selection.
The useDatePicker
hook provides state
and helpers
to manage the DatePicker
state.
Name | Type | Description | Default |
---|
The useDatePickerOverlay
hook provides state
and helpers
to manage the DatePickerOverlay
state.
Name | Type | Description | Default |
---|
DatePicker
provides a context to the children
contained within it and a composable API that enables you to create your own date picker controls.
Salt provides the following children
for convenience:
DatePickerOverlay
- a container component for the content of theDatePicker
overlay.
When selectionVariant
is "single":
DatePickerSingleInput
- a composableDateInput
component pre-wired to theDatePicker
selection context.DatePickerSinglePanel
- a composableCalendar
component pre-wired to theDatePicker
selection context.
A composable API enables you to use provided child components, such as DatePickerSingleInput
and DatePickerSinglePanel
.
When selectionVariant
is "range":
DatePickerRangeInput
- a composableDateInput
component pre-wired to theDatePicker
selection context.DatePickerRangePanel
- composableCalendar
components pre-wired to theDatePicker
selection context.
A composable API enables you to use provided child components, such as DatePickerRangeInput
and DatePickerRangePanel
.
You can also compose your own overlay content with the provided components.
A composable API enables you to combine the provided child components with your own.
Use a DatePicker
component when you need a visual and intuitive interface for selecting single dates or date ranges, making it ideal for financial applications, event scheduling, and project management. In contrast, use a Dropdown
when the dates are pre-determined, the selection is infrequent, or a compact interface is required, such as selecting a birth year or a specific month in a form.
To improve consistency and simplify your messaging, recommend a single acceptable date format in the form field label and helper text—preferably the one most frequently used in your application.
To import DatePicker
from the Salt lab package, use:
Name | Type | Description | Default |
---|
Name | Type | Description | Default |
---|
DatePickerSingleInput
composes a DateInputSingle
that uses the DatePicker
context for single date selection.
Name | Type | Description | Default |
---|
DatePickerRangeInput
composes a DateInputRange
that uses the DatePicker
context for date range selection.
Name | Type | Description | Default |
---|
DatePickerSinglePanel
composes a Calendar
that uses the DatePicker
context for single date selection.
Name | Type | Description | Default |
---|
DatePickerRangePanel
composes a Calendar
that uses the DatePicker
context for date range selection.
Name | Type | Description | Default |
---|
DatePickerOverlay
is the container component for the DatePicker
overlay.
Name | Type | Description | Default |
---|
DatePickerActions
provides the controls to apply or cancel a date selection.
The useDatePicker
hook provides state
and helpers
to manage the DatePicker
state.
Name | Type | Description | Default |
---|
The useDatePickerOverlay
hook provides state
and helpers
to manage the DatePickerOverlay
state.
Name | Type | Description | Default |
---|