Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
An specialized input to enter a range of dates.
import { DateRangeInput } from "@sharegate/orbit-ui";
A default date range input.
A date range input can have values.
A date range input can offer a predefined set of frequently used ranges:
By default, presets are displayed as compact but they could also be displayed as expanded:
A date range input can be disabled.
A date range input can be readonly.
A date range input can take the width of its container.
A date range input can display a validation state to communicate to the user whether the current value is valid or invalid. Implement your own validation logic in your app and pass either "valid"
or "invalid"
to the input via the validationState
prop.
The example below illustrates how one would validate if the date is between 05/01/1970 and 05/01/2021.
A date range input can be used in a form by providing a name
prop. When doing so, the name
attribute of each inputs will be prefixed by the specified name
prop and will respectively be suffixed by "-start-date"
and "-end-date"
.
For example, if the provided name
prop is "filter" the start date input name
attribute will be "filter-start-date"
and the end date input name
attribute will be "filter-end-date"
.
A date range input startDate
and endDate
can be handled in controlled mode.
import { DateRangeInput } from "@sharegate/orbit-ui";
Name | Description | Default | ||||||
---|---|---|---|---|---|---|---|---|
autoFocus | Whether or not the input should autoFocus on render. numberfalsetrue | - | ||||||
defaultEndDate | The initial value of end date. Date | - | ||||||
defaultStartDate | The initial value of start date. Date | - | ||||||
disabled | Whether or not the input is disabled. falsetrue | - | ||||||
endDate | A controlled end date value. Date | - | ||||||
fluid | Whether or not the input take up the width of its container. false | true | ResponsiveValue<boolean> | - | ||||||
max | The maximum (inclusive) date. Date | - | ||||||
min | The minimum (inclusive) date. Date | - | ||||||
onDatesChange | Called when the date(s) are / is applied. (event: SyntheticEvent<Element, Event>, startDate: Date, endDate: Date) => void
| - | ||||||
placeholder | Temporary text that occupies both date inputs when they are empty. string | "dd/mm/yyyy" | ||||||
presets | Array of pre-determined dates range. DateRangePreset[] | - | ||||||
presetsVariant | The presets style to use. "compact""expanded" | - | ||||||
readOnly | Whether or not the input is readonly. falsetrue | - | ||||||
required | Whether or not a user input is required before form submission. falsetrue | - | ||||||
startDate | A controlled start date value. Date | - | ||||||
validationState | Whether or not the input should display as "valid" or "invalid". "valid""invalid" | - |