SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

On this page

YearView

A calendar's year.

January

February

March

April

May

June

July

August

September

October

November

December

View code
tsx
<YearView
	year={2026}
	today="2026-11-18"
	selected="2026-11-20"
	weekStartsOn={1}
	counts={{ "2026-11-18": 5, "2026-11-19": 1, "2026-11-20": 2 }}
	dayHref={(date) => `/day/${date}`}
	monthHref={(month) => `/month/${month}`}
	labels={{ count: "{count} events" }}
/>

Installation

An ordinary dependency: install it, import the theme once, and import the component where it is used.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Usage

typescript
import { YearView } from "@sdxc/ui/schedule";

Renders the year: a heading per month (a link when monthHref is set) over its weekday initials and day links. Dots grow and darken with a day's count, so busy stretches show as texture across the year.

Props

Read from the component's own types, so every prop, every default and every allowed value is listed.

PropTypeRequiredDescription
yearnumberYes
countsRecord<string, number>NoEvents per day, keyed YYYY-MM-DD; a day missing from it is free.
todaystringNoToday, as YYYY-MM-DD, ringed.
selectedstringNoThe chosen day, as YYYY-MM-DD, filled.
dayHref(date: string) => stringYesWhere a day leads, such as its day view.
monthHref(month: string) => stringNoWhere a month's name leads, such as its month view; plain text without it.
weekStartsOn0 | 1No0 for Sunday, 1 for Monday. @default 0
localestringNo
labelsLabelsYes

Also accepts everything in Omit<TagProps<"div">, "children">.

@sdxc/ui

Can’t find it? Contact us