Skip to content
EspañolEnglish
All components (283)

Year agenda

Dates and time · YearAgenda · .amset-yearagenda

What it is and when to use it

The whole year at a glance: twelve small months, with the days that have something marked. To see where activity concentrates and jump to a day.

When to use it

  • Bookings, holidays, public holidays: what is looked at across the year.
  • events are the events (only how many fall on each day matters), and onDaySelect hands over the chosen day.
  • year is carried by whoever uses it; initialYear gives the starting one. Without either, the current one, known on reaching the browser.

When not to

  • Seeing what is on a day: MonthAgenda or WeekAgenda.
  • Choosing a date in a form: DatePicker.

Keyboard: a single tab stop on the days. The arrows move, also from one month and year to another; Page Up and Page Down change month; Enter and Space choose.

Accessibility: each month is a grid with its name and each day says its full date and how many events it has. Having something does not rely on colour alone: it goes bold and underlined.

Fine-tuning: --amset-yearagenda-day is the size of a day.

What it looks like

2026

January
February
March
April
May
June
July
August
September
October
November
December

<YearAgenda
  label="Bookings"
  events={[{ key: "a", date: "2026-01-15" }, { key: "b", date: "2026-03-03" }]}
  initialYear={2026}
/>

Props

Import it with import { YearAgenda } from '@amset/ui'. Required props are marked.

PropTypeWhat it does
eventsrequiredreadonly YearAgendaEvent[]The events: only how many fall on each day matters.
labelrequiredstringWhat is being shown: "Bookings". Required.
classNamestringMerged with the library classes; it does not replace them.
initialYearnumberThe starting year. Without this, the current one, known on reaching the browser.
onDaySelect(iso: string) => voidCalled on choosing a day, with its `YYYY-MM-DD` date.
onYearChange(year: number) => void—
selectedDaystringThe marked day.
yearnumberThe year, controlled.

It also accepts the attributes of the element it renders: className, style, data-*, aria-* and its events.

CSS variables

These CSS variables are how you adapt it. Declare them on the component's selector, not on :root: the stylesheet redeclares them in the rule itself, and a declaration on the same element always wins.

VariableDefault
--amset-yearagenda-day1.75rem

How to change it

.amset-yearagenda {
  --amset-yearagenda-day: ...;
}

In the test bench

Every state and variant, to try one at a time, on its page at storybook.amsetui.com: