DateRangePicker
@stellaria/nebula-webDateRangePickerPropsPreview
Props
26| Prop | Type | Default |
|---|---|---|
className | string | — |
color Accent of the chosen day and of the range. It goes with `variant`. | ColorExtended | "primary" |
defaultValue | DateRange | — |
description | ReactNode | — |
disabled | boolean | false |
error | string | boolean | — |
errorDisplay | ErrorDisplay | "tooltip" |
field | NebulaField<DateRange> | — |
isDateUnavailable | ((value: string) => boolean) | — |
label | ReactNode | — |
labels | CalendarLabels | — |
locale | string | — |
maxValue | string | — |
minValue | string | — |
name | string | — |
onChange | ((value: DateRange) => void) | — |
openLabel | string | "Open calendar" |
placement | PopoverPlacement | "bottom start" |
readOnly | boolean | false |
required | boolean | false |
rootClassName | string | — |
size | Size | "md" |
surface | FieldSurface | "outline" |
value | DateRange | — |
variant The recipe used to tint the chosen day in the calendar. It is the same one `Calendar` accepts: without it the calendar in the dropdown stayed pinned to `primary`, even when the product had a different accent. | CalendarVariant | "filled" |
visibleMonths | number | 2 |
Slot props
9Each one spreads over an inner element, so you can restyle a region without forking the component.
| Prop | Type | Default |
|---|---|---|
bodyProps Wrapper for the control. | BoxSlotProps | — |
descriptionProps Help text below the label. Only rendered with `description`. | TextSlotProps | — |
errorProps Configures the `FieldError`. With `errorDisplay="tooltip"` it spreads whole; with `"text"` there is no `FieldError` to configure — it is a `Text` with `role="alert"` — and only `className` is honoured. | Omit<FieldErrorProps, "children"> | — |
headerProps The label and description row. Not rendered when the field has neither. | BoxSlotProps | — |
labelProps The field label. It lands on the `<label>`, which already carries the control `htmlFor`. | TextSlotProps | — |
popoverProps The floating surface of the calendar, which is the motion wrapper and does not go through `Box`: it does not accept style props. React Aria computes its position and writes it after the slot; the `style` you pass composes with it. | OverlayMotionSlotProps | — |
requiredProps The required asterisk, which lives inside the label. Only rendered with `required`. | BoxSlotProps | — |
separatorProps The dash between the two dates. Decorative: it is `aria-hidden`. | BoxSlotProps | — |
triggerProps The button that opens the calendar. In `DatePicker` and `DateRangePicker` it is the icon at the end; in `DatePickerInput` it is the whole field, which there is a button and not a segmented field. | Omit<DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> | — |
Also accepts
On top of its own props, this component forwards these groups.