Calendar Event
- Stable
- WCAG 2.2 evidence
- RTL
An event in a month cell, a time grid or a list: Type x Layout. Built on React Aria Button
(or Link with href), so it is always a focusable control with Enter and Space (Enter on links), a visible focus ring and
a pointer target that fills the chip (WCAG 2.1.1, 2.4.7, 4.1.2). The accessible name is the whole event ("Standup, 09:00 to 09:30, Tuesday 3 March, Tentative"): title, time, day and
category, with the day and time written by Intl.DateTimeFormat in the provider's locale (1.3.1). The visible title and time
are inside the name (2.5.3). A title that is not text (elements) cannot be flattened, so then the name is built from the
content plus text visible only to assistive technology. The category is also carried by dot, icon, dashed outline or
strike-through, never by colour alone (1.4.1). Use it as the child of an EventPopover to open the event's details. Consumer duties: pass start (and end, timeZone) so the name has its date, wording of titles, and a detail view for
titles the one-line chip truncates.
import { CalendarEvent } from "@nexera-ui/react";- 9
- examples
- 33
- props
- 4
- live controls
- 1
- platform
- 11
- WCAG criteria
- 3
- blocks use it
Try every prop. Copy the code.
Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.
import { CalendarEvent } from "@nexera-ui/react";
<CalendarEvent />Examples 8
The same examples as Storybook, rendered live. Open Code to copy one.
With time
time draws the Figma Time text beside the title. It replaces the time derived from start and end.
import { CalendarEvent } from "@nexera-ui/react";
<CalendarEvent
title="1:1 Sara and Ayesha"
start={new Date("2026-03-03T06:00:00Z")}
end={new Date("2026-03-03T06:30:00Z")}
timeZone="Asia/Karachi"
/>;
Block
Figma Layout=Block: the title above the time, 160 x 56 px, for time grids. The time is derived from start and end.
import { CalendarEvent } from "@nexera-ui/react";
<div className="h-14 w-40">
<CalendarEvent
title="1:1 Sara and Ayesha"
start={new Date("2026-03-03T06:00:00Z")}
end={new Date("2026-03-03T06:30:00Z")}
timeZone="Asia/Karachi"
layout="block"
/>
</div>;
As link
With href the event is a link (an <a>), with the same name and look; Enter follows it.
import { CalendarEvent } from "@nexera-ui/react";
<CalendarEvent
title="1:1 Sara and Ayesha"
start={new Date("2026-03-03T06:00:00Z")}
end={new Date("2026-03-03T06:30:00Z")}
timeZone="Asia/Karachi"
/>;
Disabled
isDisabled: not focusable and not pressable (an event the viewer cannot open).
import { CalendarEvent } from "@nexera-ui/react";
<CalendarEvent
title="1:1 Sara and Ayesha"
start={new Date("2026-03-03T06:00:00Z")}
end={new Date("2026-03-03T06:30:00Z")}
timeZone="Asia/Karachi"
/>;
Long title
A long title is one line with an ending ellipsis; the whole title stays in the accessible name and the detail view shows it.
import { CalendarEvent } from "@nexera-ui/react";
<CalendarEvent
title="Quarterly planning session with the whole payroll and benefits team"
start={new Date("2026-03-03T06:00:00Z")}
end={new Date("2026-03-03T06:30:00Z")}
timeZone="Asia/Karachi"
time="11:00 to 11:30"
/>;
Opens event popover
The event as the trigger of an EventPopover: it gets aria-expanded and aria-controls, and focus returns to it when the popover closes. Press it, or Tab to it and press Enter.
import { CalendarEvent, EventPopover } from "@nexera-ui/react";
export function OpensEventPopover() {
return (
<EventPopover
title="1:1 Sara and Ayesha"
when="Tuesday 3 March · 11:00 to 11:30"
meta="Does not repeat · Pakistan Standard Time"
location="Lahore HQ, Room Margalla"
placement="bottom start"
>
<CalendarEvent
title="1:1 Sara and Ayesha"
start={new Date("2026-03-03T06:00:00Z")}
end={new Date("2026-03-03T06:30:00Z")}
timeZone="Asia/Karachi"
/>
</EventPopover>
);
}
Right to left
Right-to-left: the dot or icon moves to the start (right) and the title truncates at the end; the Arabic labels are translated.
import { CalendarEvent } from "@nexera-ui/react";
export function RightToLeft() {
return (
<div className="flex max-w-45 flex-col gap-2">
<CalendarEvent
title="1:1 Sara and Ayesha"
start={new Date("2026-03-03T06:00:00Z")}
end={new Date("2026-03-03T06:30:00Z")}
timeZone="Asia/Karachi"
/>
<CalendarEvent
title="إجازة سنوية"
type="out-of-office"
labels={{ outOfOffice: "خارج المكتب" }}
/>
</div>
);
}
Narrow container
In a narrow container the chip shrinks and the title truncates; it never overflows.
import { CalendarEvent } from "@nexera-ui/react";
<div className="max-w-24 border border-dashed border-default">
<CalendarEvent
title="1:1 Sara and Ayesha"
start={new Date("2026-03-03T06:00:00Z")}
end={new Date("2026-03-03T06:30:00Z")}
timeZone="Asia/Karachi"
time="11:00 to 11:30"
/>
</div>;
Props 33
Press "Try it" on a card to load that prop into the playground.
33 props shown
hrefNexerastringNo destination: the event is a button. Destination of the event page; the event becomes a link.
title*NexeraReactNodeEvent title. One line with an ending ellipsis, whole in the accessible name. Keep it short; the detail view shows the rest.
typeNexera"timed" | "all-day" | "tentative" | "declined" | "out-of-office" | "focus-time"Category. Shown by fill, stroke, a dot or an icon, and also announced as text; tentative is dashed and declined is struck through, so no category is carried by colour alone (WCAG 1.4.1).
layoutNexera"compact" | "block"Size and layout: compact is one line for month cells (180 x 20 px), block is a taller block for
time grids (160 x 56 px, the title above the time).
startNexeraDateWhen the event starts (an instant). It gives the accessible name its day ("Tuesday 3 March") and, with end, its time,
and the block layout and time derive their text from it. Without it the name has no date: pass it.
endNexeraDateWhen the event ends (an instant). With start it makes the time range "11:00 to 11:30".
timeZoneNexerastringIANA time zone the times and the day are read in (for example Asia/Karachi). Without it the viewer's time zone is
used, which differs between server and browser: pass it for server-rendered calendars.
isAllDayNexerabooleanThe event lasts all day (shown as the "All day" text and no clock times). Always true for type="all-day".
timeNexerastringVisible time text. Shown when provided; replaces the text derived from
start and end. In the compact layout nothing is shown unless this is set;
the block layout shows the derived time. The time is read in the accessible name either way.
labelsNexeraPartial<CalendarEventLabels>Translate the words added to the accessible name and the "All day" text.
isDisabledNexerabooleanDisabled (not focusable, not pressable): for events the viewer cannot open.
classNameNexerastringExtra classes for the event, merged last so they win over the defaults.
styleNexeraCSSPropertiesInline style for the event.
onPressReact Aria(e: PressEvent) => voidHandler that is called when the press is released over the target.
onPressStartReact Aria(e: PressEvent) => voidHandler that is called when a press interaction starts.
onPressEndReact Aria(e: PressEvent) => voidHandler that is called when a press interaction ends, either over the target or when the pointer leaves the target.
onPressChangeReact Aria(isPressed: boolean) => voidHandler that is called when the press state changes.
onPressUpReact Aria(e: PressEvent) => voidHandler that is called when a press is released over the target, regardless of whether it started on the target or not.
autoFocusReact AriabooleanWhether the element should receive focus on render.
formReact AriastringThe <form> element to associate the button with.
The value of this attribute must be the id of a <form> in the same document.
See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button#form).
nameReact AriastringSubmitted as a pair with the button's value as part of the form data.
valueReact AriastringThe value associated with the button's name when it's submitted with the form data.
idReact AriastringThe element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
aria-labelReact AriastringDefines a string value that labels the current element.
aria-labelledbyReact AriastringIdentifies the element (or elements) that labels the current element.
aria-describedbyReact AriastringIdentifies the element (or elements) that describes the object.
targetReact AriaHTMLAttributeAnchorTargetThe target window for the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).
relReact AriastringThe relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel).
hrefLangReact AriastringHints at the human language of the linked URL. See[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).
downloadReact Ariastring | booleanCauses the browser to download the linked URL. A string may be provided to suggest a file name. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#download).
pingReact AriastringA space-separated list of URLs to ping when the link is followed. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#ping).
referrerPolicyReact Aria"" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url"How much of the referrer to send when following the link. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#referrerpolicy).
routerOptionsReact ArianeverOptions for the configured client side router.
* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.
Accessible by default.
Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.
WCAG 2.2 evidence
6 direct · 5 supporting- 1.3.1Info and RelationshipsLevel A · tested directly
- 1.4.1Use of ColorLevel A · tested directly
- 1.4.3Contrast (Minimum)Level AA · supporting test
- 1.4.4Resize TextLevel AA · supporting test
- 1.4.12Text SpacingLevel AA · supporting test
- 2.1.1KeyboardLevel A · tested directly
- 2.4.7Focus VisibleLevel AA · tested directly
- 2.4.11Focus Not Obscured (Minimum)Level AA · supporting test
- 2.5.3Label in NameLevel A · tested directly
- 2.5.8Target Size (Minimum)Level AA · supporting test
- 4.1.2Name, Role, ValueLevel A · tested directly
Fits any width.
Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.
Styling hooks
Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.
data-disableddata-hovereddata-pressed
<CalendarEvent className="data-disabled:opacity-90 shadow-sm" />Used in blocks
- Month calendarScheduling and calendar
- Week calendarScheduling and calendar
- Event detailsScheduling and calendar
Related components
- AccordionItemOne collapsible section of an FAQ or settings page.
- AreaChartA stacked area chart: layers piled up over time with the title, range switch, actions and legend of the card.
- AvailabilityRowOne person's availability across a window of the day: an avatar with initials and the name, and a timeline with the busy periods drawn as bars.
- AvatarA person or organisation shown as a photo, initials or an icon.
- AvatarGroupA row of overlapping avatars with a "+N" chip for the rest.
- AvatarLabelAn avatar with a name and an optional subtitle beside it, for a person in a list, a header or a mention.
- BadgeShort status or category label: `Tone` x `Variant` x `Size`, with an optional dot, leading icon and remove button.
- BadgeGroupA pill that pairs a small badge with a short message, for an announcement or a status line.