Skip to content

Components · Date, time and scheduling

EventChip

One event in a calendar view: colour, title, time and status, as a button or link.

@rookcom/monarch-react/schedulingComponent

Dot chips (month cell)

Usage examples

Bar chips (agenda, all-day row)

Block chips (time grid)

As a link or popover trigger

Purpose

Shows one event the same way in every calendar view (month cell, agenda row, time grid block) and opens it. Needed by: calendar.

Use when

  • An event must appear inside CalendarMonthView, AgendaList or TimeGrid; those views render it for you.
  • A custom view (a list of upcoming bookings, a day summary in a card) needs events that look and read like the calendar’s.

Avoid when

  • The item is not a time-bound event: use Badge or StatusBadge for labels and states.
  • You need a full event card with actions: put those in the popover or page the chip opens.

Design principles

  • The product colour is only a marker, a bar and a light tint; text stays on Monarch text tokens, so any calendar colour stays readable in every theme.
  • Status is never colour alone: tentative is hollow or dashed, cancelled and declined are muted and struck through, and the status word is part of the accessible name (and visible text in bar and block).
  • The accessible name always reads "title, time, status", even when the visible time is abbreviated (timeLabel).
  • One element, one action: a button by default, a link with href, or your router link with asChild.

API reference

import { EventChip } from '@rookcom/monarch-react/scheduling';
ExportKindRenderingRoot class
EventChipcomponentserver-safe.mn-event-color

Renders a <button type="button"> (ref to it), an <a> when href is set, or the child element with asChild.

With plain-text title, time, timeLabel and detail, the chip gets a computed aria-label; with rich content the name comes from the content instead. Pass aria-label to override.

CalendarEvent is the data shape the calendar views take: { id, title, start, end?, allDay?, color?, status?, detail?, href? }.

Generated from the TypeScript declarations of packages/react/src/components/scheduling/event-chip.

Properties

EventChip

One event in any calendar view: a colour dot or accent bar, the title, the time and its status. It is a button (or a link with `href`) whose accessible name reads "title, time, status", so it can open the product's event detail or popover.

PropTypeDescription
title requiredReactNodeThe event title. Always part of the accessible name.
asChildbooleanRender the child element (a router link, or a trigger you supply) with the chip's styling and content. The child must be a single element.
childrenReactNode
classNamestring
colorstringThe event's colour (any CSS colour). It is only ever the marker, bar and a light tint behind the text; text keeps Monarch's text colours, so it stays readable in every theme. Defaults to the product accent.
density"compact" | "regular"`compact` puts a `block` chip on one line (time, then title) for short events. Default `regular`. Exposed as `data-density`.
detailReactNodeA second, muted line in `bar` and `block` chips.
disabledboolean
idstring
pastbooleanThe event has ended: drawn faded. Exposed as `data-past`.
statusEventChipStatusDefault `confirmed`. Exposed as `data-status`.
statusLabelstringText for the status in the accessible name and in `bar`/`block` chips. Defaults to the English status name.
timeReactNodeVisible time, short or long: `"09:30"` in a month cell, `"09:30 – 10:15"` in an agenda. Omit for all-day events shown in an all-day row.
timeLabelstringThe full time for assistive technology when `time` is abbreviated, for example `"9:30 to 10:15"` or `"All day"`. When set, the visible `time` is hidden from the accessible name and this text is used instead.
variantEventChipVariantDefault `dot`. Exposed as `data-variant`.

Variants

PropValuesDescription
variant'dot''bar''block'dot (default): one line, colour dot, start time, title (month cells, popovers). bar: tinted row with an accent bar, wraps a detail line (agenda, all-day row). block: fills its container, stacked lines (time grid).
status'confirmed''tentative''cancelled''declined'Exposed as data-status; see States.
density (block)'regular''compact'compact puts a short block on one line: start time, then title.
past'true''false'The event has ended: muted text and a faded marker (data-past).

States

StateExposed asBehaviour
Confirmeddata-status="confirmed"Solid marker or bar and tint.
Tentativedata-status="tentative"Hollow dot; bar/block get a lighter tint, an outline and a dashed bar. "Tentative" is in the name.
Cancelled / declineddata-status="cancelled" | "declined"Muted text, struck-through title, grey marker and surface. The status word is in the name.
Hover–Muted background (dot) or a stronger tint (bar, block).
Focus–Monarch focus ring on :focus-visible; the chip is raised above its neighbours.

Interaction behaviour

  • Click, Enter or Space activates the chip (onClick), or follows the link with href / asChild.
  • It forwards its ref and props, so it can be a PopoverTrigger or DropdownMenuTrigger child directly.

Keyboard support

KeysAction
TabMoves focus to the chip (the calendar views manage which chips are in the tab order).
Enter / SpaceActivates a button chip; Enter follows a link chip.

Accessibility

Role
button (or link)
Accessible name
"Title, time, status, detail", built from the props; timeLabel replaces an abbreviated visible time.
  • The marker is decorative (aria-hidden).
  • Status text is always in the name, so screen-reader users get the same information as the visual style.
  • Verified with axe in jsdom and in Chromium, Firefox and WebKit on /components/event-chip.
  • In forced-colours mode the bar and block get a system-colour border (dashed when tentative).

Responsive behaviour

  • Fills the width it is given and truncates the title with an ellipsis; it never forces its container wider.
  • bar wraps the detail onto its own line on narrow widths.

Theme support

  • Text, surfaces and borders are Monarch tokens, so light, dark and more-contrast themes apply automatically.
  • color is mixed into --mn-color-bg-surface (14%, 6% when tentative), so the tint follows the theme’s surface.
  • Without color the chip uses the product accent (--mn-color-accent-solid).
  • Transitions are removed under prefers-reduced-motion: reduce.

Do and don't

Do

  • Pass timeLabel when the visible time is shorter than the event (a start time in a month cell).
  • Use the calendar or service colour your product already shows elsewhere.
  • Translate statusLabel along with the rest of the UI.

Don't

  • Do not put several actions inside a chip; it is one control.
  • Do not signal status with colour only, for example a red chip for cancelled: set status.
  • Do not make a chip with no time unless it is an all-day event, and then say so in timeLabel.
  • CalendarMonthView: Renders dot chips in each day and its "+N more" popover.
  • AgendaList: Renders bar chips grouped by day.
  • TimeGrid: Renders block chips laid out by time and bar chips in the all-day row.
  • StatusBadge: For states of records that are not events.

Dependencies

KindDepends on
npm packages@radix-ui/react-slotreact
Monarch componentsNone

Testing coverage

  • Button named "title, time, status"; data-variant, data-status and the colour variable are set.
  • Confirmed status is left out of the name; timeLabel replaces an abbreviated time.
  • bar and block include status and detail in the name; compact density and past are exposed.
  • Click, Enter and Space activate it; the ref is forwarded.
  • href renders a link and asChild renders a router link with the chip’s class and content.
  • No axe violations in jsdom; renders on the server.
CheckCovered
Axe in jsdomYes
Server renderingYes
Browser suitesVisual baselines: /__gallery/event-chip; Cross-browser axe: /components/event-chip

Tests: packages/react/src/components/scheduling/event-chip