Ir al contenido

co-calendar

Pinta la cuadrícula de un mes y gestiona la selección de fecha, la navegación entre meses/años y el foco por teclado (patrón grid de WAI-ARIA, con hoy y seleccionado como estados visuales distintos). No incluye popover ni campo de texto: co-date-picker lo compone con co-date-field. El valor es una cadena YYYY-MM-DD; usa mode="range" con range-start/range-end para selección de rango.

Ver código
<co-calendar locale="es-CO" value="2026-06-15"></co-calendar>

Props

PropAtributoTipoDefaultDescripción
disabledDatesdisabled-datesstring | string[] | undefinedBlocked dates. Accepts a string[] or a JSON/comma string for raw-HTML use.
disabledDaysOfWeekdisabled-days-of-weeknumber[] | string | undefinedBlocked weekdays (0=Sun..6=Sat). Accepts number[] or a JSON/comma string.
firstDayOfWeekfirst-day-of-weeknumber1First day of the week: 0=Sunday .. 6=Saturday. Default 1 (Monday).
localelocalestring'es-CO'BCP-47 locale used for month/weekday labels.
maxmaxstring | undefinedLatest selectable date, "YYYY-MM-DD".
minminstring | undefinedEarliest selectable date, "YYYY-MM-DD".
modemode"range" | "single"'single'Selection mode.
nextMonthLabelnext-month-labelstring | undefinedOverride the "next month" button aria-label (defaults from `locale`).
prevMonthLabelprev-month-labelstring | undefinedOverride the "previous month" button aria-label (defaults from `locale`).
rangeEndrange-endnull | string | undefinedRange end (range mode), "YYYY-MM-DD" or null.
rangeStartrange-startnull | string | undefinedRange start (range mode), "YYYY-MM-DD" or null.
valuevaluenull | string | undefinedCurrently selected date (single mode), "YYYY-MM-DD" or null/empty.

Eventos

EventoDetailBubblesCancelableDescripción
coRangeSelect{ start: string | null; end: string | null; }Emitted on each range edit (range mode) with the draft endpoints.
coSelectstringEmitted when the user selects a day (single mode). Detail = "YYYY-MM-DD".

Slots

Este componente no expone slots.

CSS Parts

PartDescripción
::part(grid)The day grid
::part(header)Month navigation header
::part(root)The calendar container

CSS Custom Properties

Este componente no expone CSS custom properties.