Skip to content

co-date-range-picker

This content is not available in your language yet.

El disparador muestra el rango confirmado; el popover edita un borrador que solo se confirma al pulsar Aplicar (o, con apply-on-select, en cuanto se eligen ambos extremos, ideal para filtros de tabla). El valor es una cadena JSON con las claves from y to (YYYY-MM-DD), o vacía si no hay selección. Incluye un catálogo de presets configurable con preset-ids.

Ver código
<co-date-range-picker label="Rango" value='{"from":"2026-06-10","to":"2026-06-20"}'></co-date-range-picker>

Props

PropAtributoTipoDefaultDescripción
allowSameDayallow-same-daybooleantrueAllow from === to.
applyLabelapply-labelstring | undefined
applyOnSelectapply-on-selectbooleanfalseCommit (emit coApply) as soon as a full valid range is picked, debounced.
cancelLabelcancel-labelstring | undefined
clearLabelclear-labelstring | undefined
clearableclearablebooleantrue
disableddisabledbooleanfalse
displayFormatdisplay-formatstring'd MMM yyyy'
errorMessageerror-messagestring | undefined
firstDayOfWeekfirst-day-of-weeknumber1
fromLabelfrom-labelstring | undefined
helperTexthelper-textstring | undefined
invalidinvalidbooleanfalse
labellabelstring | undefined
layoutlayout"horizontal" | "vertical"'vertical'Label layout: vertical (label above) or horizontal (label beside)
localelocalestring'es-CO'
maxmaxstring | undefined
maxRangeDaysmax-range-daysnumber | undefinedMaximum span (inclusive days).
minminstring | undefined
minRangeDaysmin-range-daysnumber | undefinedMinimum span (inclusive days).
mobileBreakpointmobile-breakpointnumber600Max viewport width (px) that renders the picker as a bottom sheet.
openopenbooleanfalse
placeholderplaceholderstring | undefined
placementplacement"bottom" | "bottom-end" | "bottom-start" | "left" | "left-end" | "left-start" | "right" | "right-end" | "right-start" | "top" | "top-end" | "top-start"'bottom-start'
presetIdspreset-idsstring | string[] | undefinedWhich presets to show, from the built-in catalog: today, yesterday, last7Days, last14Days, last30Days, last90Days, thisWeek, thisMonth, lastMonth, thisYear, lastYear, custom. Labels come from `locale`; dates are computed tz-safe. Accepts a string[] or JSON/comma string. Defaults to a sensible set when omitted.
presetspresetsbooleantrueShow the quick-preset column.
readonlyreadonlybooleanfalse
requiredrequiredbooleanfalseWhether the field is required (renders a required marker on the label).
sizesize"lg" | "md" | "s" | "sm"'md'Trigger size (mirrors co-input): s 28 / sm 32 / md 40 / lg 48.
toLabelto-labelstring | undefined
valuevaluestring''JSON `{from,to}` or '' (empty).

Eventos

EventoDetailBubblesCancelableDescripción
coApplyDateRangeValue
coCancelvoid
coClearvoid
coClosevoid
coOpenvoid
coRangeChangeDateRangeValue
coRangeEndChangenull | string
coRangeStartChangenull | string

Slots

Este componente no expone slots.

CSS Parts

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

CSS Custom Properties

Este componente no expone CSS custom properties.