Ir al contenido

co-date-range

Date range picker. Renders an input-style trigger and, on open, a popover with optional preset chips + a single-month calendar. Selection model: - first click → sets from - second click → sets to (auto-swaps if before from) - third click → restarts (sets new from, clears to) - hover over a day with from set → previews the range value is a JSON string {"from":"YYYY-MM-DD","to":"YYYY-MM-DD"} (or empty for unset) so it survives JSX attribute serialization. coChange fires with {from, to} only when the user clicks “Apply”.

Ver código
<co-date-range label="Ejemplo"></co-date-range>

Props

PropAtributoTipoDefaultDescripción
applyLabelapply-labelstring'Apply'
clearLabelclear-labelstring'Clear'
clearableclearablebooleantrue
disableddisabledbooleanfalse
helperTexthelper-textstring''
labellabelstring''
localelocalestring'es'BCP-47 locale tag used by Intl.DateTimeFormat.
placeholderplaceholderstring'Select range'
presetLast30DaysLabelpreset-last-3-0-days-labelstring'Last 30 days'
presetLast90DaysLabelpreset-last-9-0-days-labelstring'Last 90 days'
presetThisMonthLabelpreset-this-month-labelstring'This month'
presetThisWeekLabelpreset-this-week-labelstring'This week'
presetThisYearLabelpreset-this-year-labelstring'This year'
presetTodayLabelpreset-today-labelstring'Today'
presetspresetsbooleantrue
statusstatus"default" | "error" | "success"'default'
valuevaluestring''JSON `{from, to}` or empty string.

Eventos

EventoDetailBubblesCancelableDescripción
coChangeDateRangeValue
coClearvoid

Slots

Este componente no expone slots.

CSS Parts

PartDescripción
::part(helper)
::part(label)
::part(popover)
::part(root)
::part(trigger)

CSS Custom Properties

Este componente no expone CSS custom properties.