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 | undefined
clearLabelclear-labelstring | undefined
clearableclearablebooleantrue
disableddisabledbooleanfalse
helperTexthelper-textstring''
labellabelstring''
localelocalestring'es'BCP-47 locale.
placeholderplaceholderstring'Select range'
presetspresetsbooleantrue
valuevaluestring''JSON `{from,to}` or empty string.

Eventos

EventoDetailBubblesCancelableDescripción
coChangeDateRangeValueFires (with `{from,to}`) when the user applies a range.
coClearvoid

Slots

Este componente no expone slots.

CSS Parts

Este componente no expone CSS parts.

CSS Custom Properties

Este componente no expone CSS custom properties.