Skip to content
Inputs & Forms

DateRangePicker

client103.25 kB
@stellaria/nebula-webDateRangePickerProps

Preview

Props

26
PropTypeDefault

className

string

—

color

Accent of the chosen day and of the range. It goes with `variant`.

ColorExtended"primary"

defaultValue

DateRange

—

description

ReactNode

—

disabled

booleanfalse

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

booleanfalse

required

booleanfalse

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

number2

Slot props

9

Each one spreads over an inner element, so you can restyle a region without forking the component.

PropTypeDefault

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.

Style props · 127