Rost

← All components

component

Calendar

A month to pick a date from: its name between two arrows, the days of the week, and six weeks of CalendarDays. The arrow keys move a day or a week.

In code Contract: review Guidance: proposed Contract on GitHub Figma 750:34 As markdown

Try it

Every variant

November 2026

MoTuWeThFrSaSu
Default

Install

npx github:Runceanu/rost add calendar

It lands in src/rost/calendar/, with what it needs and its contract. Install has the rest.

When to use

  • Picking a day

    An invoice's date, the day a payment came in. Put it in a Popover under a date field, or on the page when choosing the date is the task.

When not to use

  • A date someone knows by heart

    A birthday or a year far away is quicker to type. That's an Input.

    Use Input

  • A range

    From and to isn't done yet. Two Calendars, one for each end, for now.

Behaviour

It shows six weeks, always, so it doesn't change height between months. The arrows change the month. In the grid, the arrow keys move a day or a week, Home and End to the week's ends, Page Up and Page Down a month, and Enter or Space picks. Moving past the month's edge turns the page. It calls onValueChange with the picked date and onMonthChange when the month changes. With range it picks two ends instead: the first press is the start, the second the end (swapped if it's earlier), and a third starts again. While only the start is picked, the days up to the one under the pointer or the focus show as the range would be.

Accessibility

  • Element

    A grid (role="grid") named by the month's title, with a header row of columnheaders whose names are the days in full. Only one day is in the tab order: the picked one, or today, or the first.

  • Name

    The month and year. Each day's button says its whole date.

  • Colour

    The title is 17:1 and the days of the week 7:1 on the dark page.

Content

Let the locale name the month and the days. Monday first unless the people using it count from Sunday.

Props

PropTypeValuesDefault
value node
range node
onRangeChange node
month node
today node
min node
max node
weekStartsOn number 1
locale string en
autoFocus boolean false

Values

Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.

Never changes

root

  • gap 8px spacing/gap/small

displayinline-flex · flex-directioncolumn

header

displayflex · align-itemscenter · justify-contentspace-between

title

  • margin 0px spacing/gap/none
  • font-family 'General Sans Variable' font-family/base
  • font-weight 500 typography/paragraph/font-weight/medium
  • font-size 14px typography/paragraph/font-size
  • line-height 20px typography/paragraph/line-height
  • letter-spacing 0px typography/paragraph/letter-spacing
  • color #ededed calendar/title

grid

  • grid-template-columns repeat(7, var(--spacing-size-medium)) on purpose: Composed from a token: seven columns, each a day wide.

displaygrid

row

displaycontents

weekday

  • padding-bottom 8px spacing/gap/small
  • font-family 'General Sans Variable' font-family/base
  • font-weight 400 typography/label/font-weight/regular
  • font-size 12px typography/label/font-size
  • line-height 14px typography/label/line-height
  • letter-spacing 0px typography/label/letter-spacing
  • color #999999 calendar/weekday

text-aligncenter

cell

displaycontents

Part of Calendar

CalendarDay

One day in a Calendar: a 40px square with its number. Green when picked, green text for today, grey for the months either side, faint when it can't be picked.

In code Contract: review Guidance: proposed Contract on GitHub Figma 750:32 As markdown
Default · Default
Outside · Default
Today · Default
Selected · Default
Disabled · Default
Range · Default

Hover, press or tab to one to see the other 5 states.

Install

npx github:Runceanu/rost add calendar-day

It lands in src/rost/calendar-day/, with what it needs and its contract. Install has the rest.

When to use

  • Picked and today

    The picked day is filled green. Today is green text in medium weight, so it's found without being mistaken for the pick.

  • A range

    Both ends are filled green as a picked day is, and the days between them a dark green, so the stretch reads as one.

When not to use

  • On its own

    A CalendarDay only makes sense in a Calendar, which sets its status and moves the focus between days.

Behaviour

A day from either side of the month is grey and can still be picked; it moves the Calendar to that month. A disabled day can be reached with the keyboard, so the grid has no holes, but pressing it does nothing.

Accessibility

  • Element

    <button> inside a gridcell. Its name is the whole date in the locale's words, like November 17, 2026. The picked one has aria-selected, today aria-current="date", a disabled one aria-disabled.

  • Colour

    The numbers are 17:1, the grey ones 7:1 and today's green 10:1 on the dark page. Disabled days are faint on purpose, 1.8:1, and not counted.

Props

PropTypeValuesDefault
status enum default · outside · today · selected · disabled · range default
children slot

States: Default, Hover, Focus.

Values

Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.

Never changes

root

  • width 40px spacing/size/medium
  • height 40px spacing/size/medium
  • padding 0px spacing/gap/none
  • border-radius 8px spacing/radius/small
  • font-family 'General Sans Variable' font-family/base
  • font-weight 400 typography/paragraph/font-weight/regular
  • font-size 14px typography/paragraph/font-size
  • line-height 20px typography/paragraph/line-height
  • letter-spacing 0px typography/paragraph/letter-spacing

displayinline-flex · align-itemscenter · justify-contentcenter · bordernone · backgroundtransparent · outlinenone · cursorpointer

Changes by variant

16 variants. Each table is what one thing changes with: a column per status, a row per property. Where every row starts with the same token path, it's written once, under the property.

Follows status

Focus

PropertyDefaultOutsideTodaySelectedDisabledRange
root.outlinevar(--spacing-outline-medium) solid … calendar-day-focus-ring calendar-day-focus-ring calendar-day-focus-ring calendar-day-selected-focus-ring calendar-day-focus-ring calendar-day-focus-ring
root.outline-offsetcalc(-1 * …) spacing-outline-medium spacing-outline-medium spacing-outline-medium spacing-outline-large spacing-outline-medium spacing-outline-medium

Follows status and state

Default

PropertyDefaultHoverFocus
root.background · calendar-day/hover/background #006f27·
root.colorcalendar-day/… default/label #ededed hover/label #ededed default/label #ededed

Outside

PropertyDefaultHoverFocus
root.background · calendar-day/hover/background #006f27·
root.colorcalendar-day/… outside/label #999999 hover/label #ededed outside/label #999999

Today

PropertyDefaultHoverFocus
root.background · calendar-day/hover/background #006f27·
root.colorcalendar-day/… today/label #00d669 hover/label #ededed today/label #00d669

Selected

PropertyDefaultHoverFocus
root.backgroundcalendar-day/selected/… background #00d669· background #00d669
root.colorcalendar-day/selected/… label #060805· label #060805

Disabled

PropertyDefaultHoverFocus
root.colorcalendar-day/disabled/… label #3a3a3a· label #3a3a3a

Range

PropertyDefaultHoverFocus
root.backgroundcalendar-day/… range/background #004c19 hover/background #006f27 range/background #004c19
root.colorcalendar-day/… range/label #ededed hover/label #ededed range/label #ededed

Only in some variants

These don't change: they're just set in some variants and not others.

Disabled

  • root.cursor default Figma frame size

In 5 variants

  • root.font-weight 500 typography/paragraph/font-weight/medium