Skip to content

Calendar

An accessible, always-visible inline calendar. Supports day / month / year drill-down views, min/max bounds, disabled weekend days, theming, and native form association. Use this when you want the calendar rendered directly in the page — see Date Picker for the trigger + popup variant.

With Pre-selected Value

PreviewCode
RTL
html
<ore-calendar value="2025-06-15"></ore-calendar>

Min / Max Bounds

PreviewCode
RTL
html
<ore-calendar value="2025-06-15" min="2025-06-01" max="2025-06-30"></ore-calendar>

Disabled Weekends

Pass a JSON array of day-of-week indices (0 = Sunday … 6 = Saturday) to weekend-days.

PreviewCode
RTL
html
<ore-calendar weekend-days="[0,6]"></ore-calendar>

Colors

PreviewCode
RTL
html
<div style="display:flex;gap:1rem;flex-wrap:wrap;">
  <ore-calendar value="2025-06-10" color="primary"></ore-calendar>
  <ore-calendar value="2025-06-10" color="secondary"></ore-calendar>
</div>
PreviewCode
RTL
html
<div style="display:flex;gap:1rem;flex-wrap:wrap;">
  <ore-calendar value="2025-06-10" color="success"></ore-calendar>
  <ore-calendar value="2025-06-10" color="warning"></ore-calendar>
  <ore-calendar value="2025-06-10" color="error"></ore-calendar>
</div>

Calendar Events

Pass an array of CalendarEvent objects via the events JS property. Each entry requires an id, a date (ISO 8601), and a label. An optional color accepts any CSS color value.

Normal mode — up to 3 colored dots per cell; additional events appear as a +N count.

Expanded mode — up to 3 colored pills with labels; additional events appear as +N more.

PreviewCode
RTL
html
<ore-calendar id="cal-events" value="2025-06-15"></ore-calendar>
<script>
  document.getElementById('cal-events').events = [
    { id: '1', date: '2025-06-10', label: 'Team standup', color: 'var(--color-primary)' },
    { id: '2', date: '2025-06-10', label: 'Lunch with Alice' },
    { id: '3', date: '2025-06-15', label: 'Release v2.0', color: '#e11d48' },
    { id: '4', date: '2025-06-20', label: 'Sprint review' },
    { id: '5', date: '2025-06-20', label: 'Retro', color: 'var(--color-success)' },
    { id: '6', date: '2025-06-20', label: 'Deploy', color: 'var(--color-warning)' },
    { id: '7', date: '2025-06-20', label: 'Post-mortem' },
  ];
</script>

Expanded with events

PreviewCode
RTL
html
<ore-calendar id="cal-exp-events" expanded value="2025-06-15"></ore-calendar>
<script>
  document.getElementById('cal-exp-events').events = [
    { id: '1', date: '2025-06-10', label: 'Team standup', color: 'var(--color-primary)' },
    { id: '2', date: '2025-06-10', label: 'Lunch with Alice' },
    { id: '3', date: '2025-06-15', label: 'Release v2.0', color: '#e11d48' },
    { id: '4', date: '2025-06-20', label: 'Sprint review' },
    { id: '5', date: '2025-06-20', label: 'Retro', color: 'var(--color-success)' },
  ];
</script>

Events overflow

When a day has more than 3 events, the first 3 are shown and the rest are summarised. This applies to both dots (normal mode) and pills (expanded mode).

PreviewCode
RTL
html
<ore-calendar id="cal-overflow" value="2025-06-15"></ore-calendar>
<script>
  document.getElementById('cal-overflow').events = [
    { id: '1', date: '2025-06-15', label: 'Standup', color: 'var(--color-primary)' },
    { id: '2', date: '2025-06-15', label: 'Design review' },
    { id: '3', date: '2025-06-15', label: 'Release v2.0', color: '#e11d48' },
    { id: '4', date: '2025-06-15', label: 'Retrospective', color: 'var(--color-success)' },
    { id: '5', date: '2025-06-15', label: 'Deploy to prod', color: 'var(--color-warning)' },
  ];
</script>
PreviewCode
RTL
html
<ore-calendar id="cal-overflow-exp" expanded value="2025-06-15"></ore-calendar>
<script>
  document.getElementById('cal-overflow-exp').events = [
    { id: '1', date: '2025-06-15', label: 'Standup', color: 'var(--color-primary)' },
    { id: '2', date: '2025-06-15', label: 'Design review' },
    { id: '3', date: '2025-06-15', label: 'Release v2.0', color: '#e11d48' },
    { id: '4', date: '2025-06-15', label: 'Retrospective', color: 'var(--color-success)' },
    { id: '5', date: '2025-06-15', label: 'Deploy to prod', color: 'var(--color-warning)' },
  ];
</script>

Expanded Layout

Use expanded for a full-page, calendar-app style layout. Each day cell becomes tall with the day number shown as a circle in the top-left corner, leaving the remaining space for event content. The minimum cell height defaults to var(--size-28) and can be overridden with --calendar-expanded-cell-height.

PreviewCode
RTL
html
<ore-calendar expanded value="2025-06-15"></ore-calendar>
PreviewCode
RTL
html
<ore-calendar expanded value="2025-06-15" color="primary"></ore-calendar>

Disabled

PreviewCode
RTL
html
<ore-calendar value="2025-06-15" disabled></ore-calendar>

Localised

PreviewCode
RTL
html
<div style="display:flex;gap:1rem;flex-wrap:wrap;">
  <ore-calendar locale="fr-FR" value="2025-06-15"></ore-calendar>
  <ore-calendar locale="ar-SA" value="2025-06-15"></ore-calendar>
</div>

Inside a Form

PreviewCode
RTL
html
<form id="booking-form">
  <ore-calendar name="appointment" value="2025-06-15" required></ore-calendar>
  <button type="submit" style="margin-top:1rem">Submit</button>
</form>
<script>
  document.getElementById('booking-form').addEventListener('submit', (e) => {
    e.preventDefault();
    const data = new FormData(e.target);
    alert('appointment: ' + data.get('appointment'));
  });
</script>

Listening for Changes

js
document.querySelector('ore-calendar').addEventListener('change', (e) => {
  console.log(e.detail.isoValue); // '2025-06-15' or null
});

View Cycling

The header label button cycles through three views on each click:

  1. Day — the standard month grid; Previous/Next navigate by month
  2. Month — a 4×3 grid of abbreviated month names; click a month to return to day view at that month
  3. Year — a 4×3 grid of year numbers; click a year to go to month view for that year

The calendar panel maintains a stable size across all three views — day view reserves space for a maximum 6-week month, and month/year views fill the same width.

API Reference

Props

PropTypeDefaultDescription
valuestringSelected date in ISO 8601 format (yyyy-MM-dd)
minstringEarliest selectable date (yyyy-MM-dd, inclusive)
maxstringLatest selectable date (yyyy-MM-dd, inclusive)
weekend-daysnumber[][]JSON array of day-of-week indices to disable (0 = Sunday … 6 = Saturday). e.g. weekend-days="[0,6]"
localestringbrowser localeBCP 47 locale string for day/month names
colorstringTheme color: primary | secondary | info | success | warning | error
sizestringmdComponent size: sm | md | lg
roundedstringBorder radius override
disabledbooleanfalseDisable all interaction
requiredbooleanfalseRequired field (form association)
namestringForm field name
eventsCalendarEvent[][]Calendar events to display. Dots in normal mode, pills in expanded mode. Set via JS property
expandedbooleanfalseExpanded calendar-app layout with tall cells and top-aligned day number circles
fullwidthbooleanfalseExpand calendar to full container width

CalendarEvent

FieldTypeRequiredDescription
idstringYesUnique identifier
datestringYesISO 8601 date the event falls on (yyyy-MM-dd)
labelstringYesShort label shown in the cell (pill text in expanded mode)
colorstringAny CSS color value. Falls back to the component's theme color

Events

EventDetailDescription
change{ isoValue: string | null }Fired when a date is selected. isoValue is the ISO 8601 date string or null when cleared

CSS Custom Properties

PropertyDefaultDescription
--calendar-bg--color-canvasCalendar background colour
--calendar-border-color--color-contrast-200Calendar border colour
--calendar-radius--rounded-xlCalendar border radius
--calendar-shadow--shadow-mdCalendar drop shadow
--calendar-day-selected-bgtheme focus colorBackground of the selected day cell
--calendar-day-today-colortheme focus colorColor of today's date number
--calendar-day-outside-opacity0.35Opacity of days outside the visible month
--calendar-expanded-cell-heightvar(--size-28)Minimum height of each day cell in the expanded layout

Parts

PartDescription
calendarThe root calendar panel
headerCalendar header (nav buttons + label)
gridThe day grid
dayIndividual day cell

Accessibility

ore-calendar implements the ARIA Grid Pattern. The host element carries role="group" and aria-label set to the currently visible month/year. Each view (day/month/year) uses role="grid" with cells grouped into role="row" elements — role="columnheader" for the day view's weekday headers, role="gridcell" on every day/month/year cell.

Selected days have aria-selected="true"; unselected days have aria-selected="false". Today's cell carries aria-current="date". Out-of-range and disabled-weekday cells have aria-disabled="true" and tabindex="-1", removing them from tab order. When the disabled attribute is set on the host, it receives aria-disabled="true", all cells become tabindex="-1", and no interaction is processed.

Keyboard Navigation

Day grid

KeyAction
ArrowRightMove focus to the next day
ArrowLeftMove focus to the previous day
ArrowDownMove focus one week forward (same weekday)
ArrowUpMove focus one week back (same weekday)
HomeMove focus to the first day of the current row
EndMove focus to the last day of the current row
Enter / SpaceSelect the focused day

Month and year grids

KeyAction
ArrowRightMove focus to the next cell
ArrowLeftMove focus to the previous cell
ArrowDownMove focus one row forward (4-column grid)
ArrowUpMove focus one row back (4-column grid)
HomeMove focus to the first cell of the current row
EndMove focus to the last cell of the current row
Enter / SpaceSelect the focused month / year

Header controls

KeyAction
Click / EnterPrevious / Next button — navigate by month or year
Click / EnterLabel button — cycle view: Day → Month → Year → Day
  • Date Picker — trigger + popup wrapper around the same calendar logic