0.1.0-rc.2

Calendar

Calendars let users pick one or more dates from a month grid. They support single, multiple, and range selection without leaving the surrounding form.

Try it

August 2026

Usage

Bind value as an ISO date string. Use selectionMode to switch between a single day, multiple days, or a start/end range.

import { RuiCalendar } from '@ecopages/radiant-ui/calendar';
 
<RuiCalendar
  selectionMode="single"
  value="2026-08-07"
  min="2026-01-01"
  max="2026-12-31"
/>

Selection modes

single selects one date. multiple accepts comma-separated values. range expects start/end in value.

Constrain selectable dates

Set min and max to block out-of-range bookings or past dates. Pair with visibleMonths for multi-month range pickers.

Theming

Calendar surfaces map to semantic surface and selection roles, never Tailwind palette steps:

PartCSS roles
Month surface (rui-calendar)border, background, radius-container, space-inset, shadow-sm
Month title / weekday labelson-background, on-surface
Nav + today buttonsrounded-control, surface hover, on-surface, primary text
Selected dayprimary, on-primary (hover: primary-container, on-primary-container)
Range preview / middle daysprimary at reduced opacity
Outside-month / disabled dayson-surface + opacity-muted
Focus ringfocus-ring

Geometry shares control tokens (--size-control-*, --radius-control, --space-control-*) with RuiInput and RuiButton so adjacent form rows align. Override at the theme layer (tokens/presets/colors/*.css, tokens/radius/*.css), not in component CSS.

API

RuiCalendar is a custom element (<rui-calendar>) that renders its own light-DOM month grid(s).

Attributes

AttributeTypeDefaultDescription
valuestring''Selected date(s) in the mode-specific ISO format.
minstring''Earliest selectable ISO date.
maxstring''Latest selectable ISO date.
disabledbooleanfalseDisable all date selection.
localestring''BCP 47 locale tag, or comma-separated fallback list.
selection-modesingle · multiple · rangesingleSingle, multiple, or range selection.
visible-monthsnumber1Month grids shown side by side.
page-behaviorvisible · singlevisibleWhether paging moves by all visible months or one month.

Events

EventDetailDescription
rui-change{ value, start?, end? }Fired when the selection changes; start / end are set for range mode.

CSS classes

Public BEM classes on the composed light-DOM surface (documented via @cssclass on RuiCalendar):

ClassDescription
.rui-calendarRoot surface (role="application").
.rui-calendar--multiMulti-month root modifier.
.rui-calendar__monthsRow of month panels.
.rui-calendar__month-panelSingle month grid column.
.rui-calendar__headerMonth title row with paging controls.
.rui-calendar__navPrev / next month button.
.rui-calendar__nav-spacerPlaceholder where a nav button is absent.
.rui-calendar__monthMonth title.
.rui-calendar__weekdaysWeekday header row.
.rui-calendar__weekdayWeekday label.
.rui-calendar__gridMonth grid (role="grid").
.rui-calendar__weekGrid row.
.rui-calendar__dayDay cell button (role="gridcell").
.rui-calendar__footerFooter row with the today button.
.rui-calendar__today"Today" jump button.

Theme roles

PartCSS variables consumed
Month surface--border, --background, --radius-container, --space-inset, --shadow-sm
Month title / weekday labels--on-background, --on-surface
Nav + today buttons--radius-control, --surface, --on-surface, --primary
Selected day--primary, --on-primary, --primary-container, --on-primary-container
Range preview / middle days--primary
Outside / disabled--on-surface, --opacity-muted
Focus ring--focus-ring

Accessibility

  • Day cells expose grid semantics with arrow-key navigation between dates.
  • Selected and today states are communicated with aria-selected and visible styling.
  • Provide a visible label or aria-label when the calendar is not described by surrounding text.