Dot Calendar
A date picker drawn in a small dot face. A picked day is a solid block with its number knocked out, a range is a stipple running between its ends (it follows the pointer while you choose the second), and marked days carry a dot under the number. Underneath is a real grid of buttons, so the keyboard works as it should: arrows, Page Up and Down for months (with Shift for years), Home and End, and T for today.
Needs: None. Canvas 2D over a grid of real buttons.
Customize
mode
locale
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| mode | "single" | "range" | "single" | Pick one day, or a start and an end. |
| value | string | null | DateRange | – | The picked day as YYYY-MM-DD, or { start, end } in range mode. Leave unset to let it keep its own. |
| defaultValue | string | null | DateRange | – | What's picked at first, when value isn't set. |
| onChange | (value) => void | – | Called with the day, or the range, as it's picked. |
| defaultMonth | string | – | The month shown first. The picked day's month, or this one, by default. |
| min | string | – | The earliest day that can be picked. |
| max | string | – | The latest day that can be picked. |
| disabled | (date: string) => boolean | – | Days that can't be picked, like weekends or booked dates. |
| marks | Record<string, string | true | (string | true)[]> | – | Days with something on: a dot under the number in a colour, or up to three. |
| locale | string | "en" | Month and weekday names, and which day weeks start on. |
| weekStart | number | – | First day of the week, 0 Sunday to 6 Saturday. From the locale by default. |
| tone | string | – | The selection, today and focus colour. The page's accent by default. |
| pitch | number | 4 | Size of one dot in px. The calendar is 77 by 70 dots. |
| label | string | "Calendar" | Read out by screen readers. |
| className | string | – | Class on the calendar. |
| style | CSSProperties | – | Style on the calendar. |