Skip to content

DocsNavigationCalendar

PT

Navigation

Calendar

A month with range selection: click the start, hover to preview the range and click the end.

data-u="calendar"

Example

Installation

Calendar ships in the full package, in unslop.css and unslop.js:

curl -fsSL unslop.leallabs.dev/i | sh

A ready-made block that uses calendar:

curl -fsSL unslop.leallabs.dev/i | sh -s add wall-calendar

No build Name-based add is for charts and blocks. Components with JS live in unslop.js, which mounts every data-u on the page by itself.

Props

They go in data-u-props, as JSON.

PropTypeDefaultWhat it does
yearnumber2026Year it opens on.
monthnumber6Month it opens on, counting from 0 (0 is January, 6 is July).
start[year, month, day][2026, 6, 7]Range start. Month also counts from 0.
end[year, month, day][2026, 6, 14]Range end.

Accessibility and keyboard

State and roles

WhereAttributeWhat it says
gridrole="grid", role="columnheader", role="gridcell"Days are buttons inside the grid.
range end daysaria-selected="true"Start and end of the range.
month titlearia-live="polite"Announces the month when it changes.
month arrowsaria-label"Previous month" and "Next month".

Keyboard

KeyDoes
Tabmoves through days and buttons
Enter or Spacepicks the day

Events and API

EventdetailWhen
u:apply{ start: Date, end: Date }When Apply is clicked with a range selected.

Every event bubbles up the page. Listen on the element itself: el.addEventListener("u:apply", (e) => e.detail).

Type to search. Arrows pick, Enter opens.