Calendar

Data Display
stable

Full-featured calendar with month, week, day and agenda views, drag-select, event colouring by category and v-model bindings.

Preview

Rendering the live preview…

month view

Rendering the live preview…

week view

Rendering the live preview…

agenda view

Structure

Anatomy

Visual breakdown of the component's internal structure with BEM class call-outs.

Anatomy of OrigamCalendarSchematic of the Calendar component with 5 numbered internal parts. Toolbar: prev / today / next · title · view switcher Mon · Tue · Wed · Thu · Fri · Sat · Sun Team Meeting Lunch 1 2 3 4
Anatomy of <origam-calendar> — 4 visible parts: toolbar ①, weekday header row ②, day-cell grid ③ and event chips ④. The role="application" root handles all keyboard events via a single @keydown handler.
1.origam-calendar__toolbar
Navigation and view-switcher toolbar. role="toolbar" with aria-label. Contains prev/today/next BtnGroup and view BtnGroup.
2.origam-calendar__weekdays
Weekday header row. role="row" with columnheader children. Rendered only in month view.
3.origam-calendar__month-grid
Month grid with role="grid". Contains __month-row (role="row") > __day-cell (role="gridcell").
4.origam-calendar__event
Event chip (

API

Props

All props accepted by this component, with their type, default value and description.

view
'month'
Active view mode: "month", "week", "day" or "agenda". Supports v-model:view.
currentDate
Date | string
new Date()
Anchor date. The calendar renders the period containing this date. Supports v-model:currentDate.
events
Array<IEvent>
[]
Event list. Recurring events are expanded internally. Each event requires id, title, start and end fields.
firstDayOfWeek
0 | 1 | 2 | 3 | 4 | 5 | 6
1
First weekday rendered as the leftmost column. 1 (Monday) for EU/ISO, 0 (Sunday) for US locales.
timeFormat
'24h'
Clock format for timeline hour labels: "24h" or "12h".
locale
string
navigator.language
BCP 47 locale tag driving weekday and month names (e.g. "fr-FR", "en-US").
selectable
boolean
true
Enable drag-select on the month grid and timeline slots. Fires range-select and create-event-request emits.
eventColorKey
'category' | 'color' | string
'category'
Which IEvent property to read for colouring. "category" uses categoryColors map; "color" reads the event.color directly.
categoryColors
Record<string, TIntent | string>
{}
Map of category string to intent token or CSS colour (e.g. { work: "primary", personal: "success" }).
weekendHighlight
boolean
true
Tint Saturday and Sunday cells in month and week views with the surface.sunken background.
showWeekNumbers
boolean
false
Render a leading ISO week-number column. Useful for project or billing calendars.
dayStartHour
number
0
First hour rendered in week/day timeline views.
dayEndHour
number
24
Last hour rendered in week/day timeline views.
slotDuration
number
30
Minutes per timeline row. 30 for half-hour granularity, 15 for fine-grained drag-create, 60 for compact.
minDate
Date | string
Lower navigation bound. The prev toolbar button is disabled when the current date would go below this.
maxDate
Date | string
Upper navigation bound. The next toolbar button is disabled when the current date would exceed this.
disabledDates
Array<Date | string> | ((d: Date) => boolean)
Dates to grey out. Accepts an array of Date/ISO strings or a predicate function for dynamic rules.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
color
Intent or custom foreground color.
bgColor
Background color override.
Border-radius token or boolean.
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string
elevation
TElevation
Box-shadow elevation token.
border
boolean | number | string | TDirectionBoth | Array<TDirectionBoth>
false
Applies a border to the calendar container.
borderTop
boolean | number | string
borderLeft
boolean | number | string
borderBottom
boolean | number | string
borderRight
boolean | number | string
borderBlock
boolean | number | string
borderInline
boolean | number | string
borderInlineStart
boolean | number | string
borderInlineEnd
boolean | number | string
borderBlockStart
boolean | number | string
borderBlockEnd
boolean | number | string
borderColor
string
borderStyle
string
borderTopColor
TColor
borderRightColor
TColor
borderBottomColor
TColor
borderLeftColor
TColor
borderInlineStartColor
TColor
borderInlineEndColor
TColor
borderBlockStartColor
TColor
borderBlockEndColor
TColor
density
'default'
Density modifier.
height
number | string
Calendar container height.
maxHeight
number | string
maxWidth
number | string
minHeight
number | string
minWidth
number | string
width
number | string
Calendar container width.
padding
boolean | number | string
paddingTop
boolean | number | string
paddingLeft
boolean | number | string
paddingBottom
boolean | number | string
paddingRight
boolean | number | string
paddingBlock
boolean | number | string
paddingInline
boolean | number | string
paddingInlineStart
boolean | number | string
paddingInlineEnd
boolean | number | string
paddingBlockStart
boolean | number | string
paddingBlockEnd
boolean | number | string
margin
boolean | number | string
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string

API

Slots

Content slots exposed by this component.

#header
Replace the entire toolbar (prev/today/next + title + view switcher).
#event
Override event chip / block rendering for every visible event.
#day
Override an entire day cell in month view.
#dayHeader
Override the day header in week view (weekday name + date number).
#empty
Shown in agenda view when there are no events in the visible range.

API

Emits

Events emitted by this component.

@update:view
TCalendarView
Fired when the user switches view (month/week/day/agenda). Supports v-model:view.
@update:currentDate
Date
Fired when the anchor date changes via navigation. Supports v-model:currentDate.
@event-click
IEvent, MouseEvent
Fired when the user clicks an event chip or block. Payload: the event object + DOM event.
@date-click
Date
Fired when the user clicks an empty day cell.
@range-select
Date, Date
Fired when the user finishes a drag-select. Payload: start and end Date of the selection.
@create-event-request
Date, Date
Fires alongside range-select as a semantic alias for "user wants to create an event here".
@view-change
TCalendarView
Alias of update:view for consumers not using v-model.
@navigate
TCalendarNavigate
Fired when the user clicks prev / next / today. Payload: "prev", "next" or "today".

API

Exposed members

Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.

ComputedRef<{ start: Date; end: Date }>
Start and end Date of the currently rendered period (useful for fetching remote events).
ComputedRef<IEvent[]>
Events after recurring expansion within the visible date range.
(direction: TCalendarNavigate) => void
Programmatically navigate: "prev", "next" or "today".
(view: TCalendarView) => void
Programmatically switch the view mode.

Customisation

CSS variables

CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.

Calendar background.
Default text color.
Container border color.
Container border-radius.
Month-view day cell height.
Background of today's cell.
Background of weekend cells when weekendHighlight=true.
Default event chip background.
Toolbar background.
Height per timeline slot row (proportional to slotDuration).

Inclusion

Accessibility

ARIA roles, keyboard navigation and focus management. Sourced from the real component template.

ARIA roles

application
toolbar
grid
row
gridcell
columnheader
rowheader
button

Keyboard interactions

Keyboard interactions
KeyAction
Arrow keysNavigate between day cells in month view or seek in timeline views.
TabMove focus between toolbar controls and day cells.
Enter / SpaceActivate a focused day cell (fires date-click) or event button (fires event-click).

Notes

  • role="application" is used on the root to indicate rich interactive content to assistive technologies. The @keydown handler manages arrow navigation.
  • Month view uses role="grid" / role="row" / role="gridcell" for full grid semantics. Week numbers use role="rowheader".
  • Each event button has an aria-label describing the event title and time range.
  • Disabled day cells receive aria-disabled="true". Drag-select is prevented on disabled cells.
  • Today's cell is identified visually with a primary background tint. Consumers should add aria-label="Today" via the #day slot for full AT support.

Foundation

Design tokens

Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.

Source
color
var(--origam-color__surface---default)
Calendar background.
dimension
120px
Month-view day cell height.
color
var(--origam-color__action--primary---bgSubtle)
Today cell background.
color
var(--origam-color__action--primary---bg)
Default event background.
fontWeight
var(--origam-font__weight---semibold)
Toolbar title font weight.
dimension
32px
Timeline slot row height.

Interactive

Playground

Edit props live and see the component update in real time. The generated code snippet updates as you change values.

Rendering the live preview…

Usage

Examples

Ready-to-paste code snippets for your templates.

Basic calendar

vue

Category color mapping

vue

Custom event slot

vue