Event
Event is the compact chip
When to use
Reach for event whenever you need the exact same compact, colored, titled,
and timed indicator scheduler itself uses for an event, such as a small
agenda widget on a dashboard, a list of upcoming appointments outside a
full calendar grid, or a notification. It's deliberately minimal: only a
title and a start time are ever shown, even when more is known about the
event, such as a description, location, notes, or priority, since those
live in the
See
Install & usage
npm install @eunomia/elements
import "@eunomia/elements/scheduler-event.js";
<eun-scheduler-event
id="chip"
label="Design review"
color="purple"
></eun-scheduler-event>
<script>
const chip = document.querySelector("#chip");
chip.start = new Date(2026, 2, 16, 11, 0);
chip.end = new Date(2026, 2, 16, 12, 0);
chip.addEventListener("click", () => {
// open your own detail view, or pass the same event into
// eun-scheduler-event-editor to edit it
});
</script>
start/end are Date properties (attribute: false, like every date
value elsewhere in this library), so set them from JavaScript, not as HTML
attributes.
Live testing
Properties
SchedulerEvent <eun-scheduler-event>
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
| direction | 'row' | 'column' | 'column' | Column stacks the title above the time as two lines. Row lays them out side by side on one line instead, the title truncating with an ellipsis while the time never does, for the month view's single-day chips on desktop, where a cell is wide but not tall |
| hide-time | boolean | false | Hides the visual time line, showing only the title. The accessible name still includes the time |
| label | string | "" | The event's title |
| color | string | 'blue' | The event's accent color : one of the six preset names (red/purple/yellow/blue/green/pink), each with its own tuned two-tone CSS, or a `#rrggbb` hex string for a fully custom color |
| variant | 'default' | 'transparent' | 'ghost' | 'default' | The visual style to apply |
| locale | string | — | The locale used to format the time label. Defaults to the runtime's own |
Import the exact TypeScript type behind any property above, see
Properties
JS-only — no matching HTML attribute, set these from a script or a template binding.
| Name | Type | Default | Description |
|---|---|---|---|
| start | Date | new Date() | The event's start time, shown as the chip's compact time label |
| end | Date | — | The event's end time. Used only to build a fuller accessible name, such as "Team sync, 9:00 AM to 10:00 AM", never shown visually on the chip |
Events
| Name | Type | Description |
|---|---|---|
| click | The native click event, fired on mouse or touch activation, or Enter or Space |
Every event above follows the same naming convention, covered in
CSS custom properties
| Name | Description |
|---|---|
| --scheduler-event-radius | Sets the corner radius |
| --scheduler-event-bar-width | Sets the width of the color bar |
| --scheduler-event-gap | Sets the gap between the bar and the text |
| --scheduler-event-padding | Sets the inner padding |
| --scheduler-event-opaque-tint | Sets the mix percentage for the default variant's background |
| --scheduler-event-transparent-tint | Sets the mix percentage for the transparent variant's background |
| --scheduler-event-title-color | Sets the title text color |
| --scheduler-event-time-color | Sets the time text color |
Colors
Six accent colors, from the library's
color, no other configuration needed.
<eun-scheduler-event label="Red" color="red"></eun-scheduler-event>
<eun-scheduler-event label="Purple" color="purple"></eun-scheduler-event>
<eun-scheduler-event label="Yellow" color="yellow"></eun-scheduler-event>
<eun-scheduler-event label="Blue" color="blue"></eun-scheduler-event>
<eun-scheduler-event label="Green" color="green"></eun-scheduler-event>
<eun-scheduler-event label="Pink" color="pink"></eun-scheduler-event>
Variants
default (the initial value) mixes color toward the current theme's own
surface color for an opaque tint that stays light in a light theme and dark
in a dark one automatically, with no extra configuration needed.
transparent mixes the same accent toward transparent instead, for a
lighter touch over a colored or patterned background. Ghost does not set
a background color.
<eun-scheduler-event
label="Default"
color="blue"
variant="default"
></eun-scheduler-event>
<eun-scheduler-event
label="Transparent"
color="blue"
variant="transparent"
></eun-scheduler-event>
<eun-scheduler-event
label="Ghost"
color="blue"
variant="ghost"
></eun-scheduler-event>
Direction
column (the initial value) stacks the title above the time on two lines,
which is what the calendar's hour grid uses for most views. row lays
them out side by side on one line instead, truncating the title with an
ellipsis while the time never does, which is what month view switches to
for a single-day chip on desktop, where a cell is wide but not tall.
<eun-scheduler-event
label="Column layout"
color="green"
direction="column"
></eun-scheduler-event>
<eun-scheduler-event
label="Row layout, with a longer title to show truncation"
color="green"
direction="row"
></eun-scheduler-event>
Hiding the time
For an all-day event (no single time to show), or any block too short to
comfortably fit a title line and a time line both, eun-scheduler sets
this automatically in its own all-day row and in condensed hour-grid and
month-view cells. Set it directly when using the chip on its own.
<eun-scheduler-event
label="Company offsite"
color="purple"
hide-time
></eun-scheduler-event>
Popover
eun-scheduler-event never opens anything itself, since clicking it only
fires a plain click, same as any other button (see "When to use" above).
"Open your own detail view" is exactly what's built below: a small popover
of your own, reusing the library's own tokens so it matches the visual
language of eun-scheduler's own read-only detail popover without pulling
in the whole calendar, down to its priority row (a priority_high icon
prefix, same as every other detail row, next to a eun-tag using
severity for the color and hide-icon since the row icon already marks
it) and shared guest list (a status icon, check/hourglass/cross for
confirmed/pending/declined, next to each email). Click the event to
open it, its own close (✕) button (or Escape) to dismiss it.
- alice@example.com
- bob@example.com
<eun-scheduler-event
id="chip"
label="Design review"
color="purple"
></eun-scheduler-event>
<div id="popover" popover style="position: fixed;">
<eun-button id="close" appearance="ghost" rounded size="s" aria-label="Close">
<eun-icon name="close" size="16"></eun-icon>
</eun-button>
<span>Design review</span>
<p>Friday, August 14 · 11:00 AM – 12:00 PM</p>
<p>Room A</p>
<p>
<eun-icon name="priority_high" size="16"></eun-icon>
<eun-tag size="s" hide-icon color="primary" severity="warning"
>High priority</eun-tag
>
</p>
<ul>
<li data-status="confirmed">✓ alice@example.com</li>
<li data-status="pending">⏳ bob@example.com</li>
</ul>
</div>
<script>
const chip = document.querySelector("#chip");
const popover = document.querySelector("#popover");
chip.start = new Date(2026, 2, 16, 11, 0);
chip.end = new Date(2026, 2, 16, 12, 0);
chip.addEventListener("click", () => {
const rect = chip.getBoundingClientRect();
popover.style.top = `${rect.bottom + 4}px`;
popover.style.left = `${rect.left}px`;
popover.showPopover();
});
document
.querySelector("#close")
.addEventListener("click", () => popover.hidePopover());
</script>
See eun-scheduler's own full
popover, which adds every optional field (notes, priority, all-day) plus
its Edit/Delete buttons, shown side by side inside a real calendar.
Keyboard interactions
| Key | Action |
|---|---|
Tab / Shift+Tab |
Moves focus to/from the chip |
Enter / Space |
Activates the chip, using native <button> behavior with no custom keyboard handling needed |
Aria attributes and rules
- Renders as a native
<button type="button">internally, so focus, activation, and the disabled/focus-visible states all come from the platform rather than being reimplemented. aria-labelcombines the title and time ("{title}, {time}", or"{title}, {start} – {end}"onceendis also set), even though only the title and start time are ever shown visually (and neither oncehide-timeis set), so a screen reader user still gets the full picture a sighted user would need to hover or open the event to learn.- The color bar is a plain
<span aria-hidden="true">, since color is never the only signal carrying meaning here, given the title/time text is always present too.