SubComponents

Control

The control subcomponent is required to render the Control of the RangeDatePicker component.

Control API

triangle-exclamation

API

This component extends the native <div>arrow-up-right API. That's why the className prop is not included in the table.

Props
Type
Required

align

'start' | 'center' | 'end'

❌

alignOffset

number

❌

side

'top' | 'right' | 'bottom' | 'left'

❌

sideOffset

number

❌

defaultOpen

boolean

❌

lang

'en' | 'es'

❌

isDisabled

boolean

❌

hasError

boolean

❌

isReadOnly

boolean

❌

format

'dd/mm/yyyy' | 'mm/dd/yyyy' | 'yyyy/mm/dd'

❌

minDate

string

❌

maxDate

string

❌

startDate

string

❌

endDate

string

❌

defaultStartDate

string

❌

defaultEndDate

string

❌

showPredefinedSelectionsMenu

boolean

❌

predefinedSelection

| 'today' | 'yesterday' | 'last7Days' | 'last30Days' | 'thisMonth' | 'lastMonth';

❌

predefinedMenuOptions

❌

daysRangeLimit

number

❌

onDateSelection

(e: RangeDatePickerSelectionEventType) => void;

❌

SelectionMenuOptions Interface

chevron-rightalignhashtag

This prop changes the position of the Menu based on the Trigger.

chevron-rightalignOffsethashtag

An offset in pixels from the "start" or "end" alignment options.

chevron-rightsidehashtag

Controls the side the menu of the DatePicker is rendered from, always based on the trigger. Will be reversed when collisions occur automatically.

chevron-rightsideOffsethashtag

The distance in pixels from the trigger.

chevron-rightdefaultOpenhashtag

Controls a default open state for the menu of the DatePicker.

chevron-rightlanghashtag

To load a SingleDatePickerlanguage between english and spanish

chevron-righthasErrorhashtag

To load an error state.

chevron-rightisDisabledhashtag

To load a disabled state.

chevron-rightisReadOnlyhashtag

To load a reaOnly state

chevron-rightformathashtag

To change the format the date is presented.

chevron-rightminDatehashtag

A minimum valid date.

chevron-rightmaxDatehashtag

A maximum valid date.

chevron-rightstartDate and endDatehashtag

When using the controlled approach, to pass a start and end date.

chevron-rightdefaultStartDate and defaultEndDatehashtag

To pass an initial start and end date.

chevron-rightshowPredefinedSelectionsMenuhashtag

This prop allows the selectionMenu to be shown.

chevron-rightpredefinedSelectionhashtag

If the prop showPredefinedSelectionsMenu is true, then this prop can be used, to pass an object of predefined selections.

chevron-rightdaysRangeLimithashtag

To mark a limit on max days selected.

chevron-rightonDateSelectionhashtag

Triggered when a date selection is done, returning an event. This is used for the controlled approach.

HelpText

The HelpText subcomponent extends the SDS HelpText component. See for reference: HelpText

Label

The Label subcomponent extends the SDS label component. See for reference: Label

Last updated