Calendar
A Neo-Brutalist Gregorian calendar supporting single, multiple, and range date selection with bold 2px borders, adaptive hard shadows, and composable caption controls.
Brutalist Calendar supports single, multiple, and range date selection in a Neo-Brutalist panel with 36px day cells, 28px navigation controls, crisp 2px borders, and an adaptive 4px hard offset shadow.
Preview
Section titled “Preview”<proto-ui-brutalist-calendar-root id="calendar-caption-demo">
<proto-ui-brutalist-calendar-caption>
<proto-ui-brutalist-calendar-previous
aria-label="Previous month"
>
‹
</proto-ui-brutalist-calendar-previous>
<proto-ui-brutalist-select-root id="calendar-month">
<!-- Month Select -->
</proto-ui-brutalist-select-root>
<proto-ui-brutalist-select-root id="calendar-year">
<!-- Year Select -->
</proto-ui-brutalist-select-root>
<proto-ui-brutalist-calendar-next aria-label="Next month">
›
</proto-ui-brutalist-calendar-next>
</proto-ui-brutalist-calendar-caption>
<proto-ui-brutalist-calendar-heading
class="sr-only"
></proto-ui-brutalist-calendar-heading>
<proto-ui-brutalist-calendar-grid>
<proto-ui-brutalist-calendar-weekdays>
<!-- 7 Weekday slots with offset 0..6 -->
</proto-ui-brutalist-calendar-weekdays>
<!-- 6 Row slots (index 0..5), each with 7 Day slots (offset 0..41) -->
</proto-ui-brutalist-calendar-grid>
</proto-ui-brutalist-calendar-root>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
import { bindCalendarCaption } from '@proto.ui/prototypes-base/calendar';
const root = document.querySelector('#calendar-caption-demo');
setElementProps(root, {
locale: 'en-US',
weekStartsOn: 0,
today: '2026-10-08',
});
// Connect month/year Select controls via bindCalendarCaption(source, { month, year })
</script>Installation
Section titled “Installation”Available starting in 0.3.0-rc.1 and later releases (@proto.ui/prototypes-brutalist/calendar).
import { CalendarRoot, CalendarCaption, CalendarPrevious, CalendarHeading, CalendarNext, CalendarGrid, CalendarWeekdays, CalendarWeekday, CalendarRow, CalendarDay,} from '@proto.ui/prototypes-brutalist/calendar';
export function BrutalistCalendarExample() { return ( <CalendarRoot mode="single" defaultMonth="2026-10" defaultValue="2026-10-12" today="2026-10-08"> <CalendarCaption> <CalendarPrevious a11yLabel="Previous month" /> <CalendarHeading /> <CalendarNext a11yLabel="Next month" /> </CalendarCaption> <CalendarGrid> <CalendarWeekdays> {Array.from({ length: 7 }, (_, offset) => ( <CalendarWeekday key={offset} offset={offset} /> ))} </CalendarWeekdays> {Array.from({ length: 6 }, (_, row) => ( <CalendarRow key={row} index={row}> {Array.from({ length: 7 }, (_, col) => ( <CalendarDay key={col} offset={row * 7 + col} /> ))} </CalendarRow> ))} </CalendarGrid> </CalendarRoot> );}Anatomy, keyboard navigation, and caption pickers
Section titled “Anatomy, keyboard navigation, and caption pickers”- Compose
Calendarfrom ten parts:Root,Caption,Heading,Previous,Next,Grid,Weekdays,Weekday,Row, andDay. - By default, the grid shows the 4–6 weeks required for the active month; pass
fixedWeeks={true}to reserve 6 rows. Unused rows and cells hide automatically off the focus path. - Calendar never reads the system clock directly: supply a
YYYY-MM-DDtodayprop from the host to highlight today (aria-current="date"). direction="rtl"mirrors Left/Right arrows automatically. Pair familySelectdropdowns withbindCalendarCaption(source, { month, year })(and calldispose()on teardown) for month/year pickers.
Selection modes
Section titled “Selection modes”| Mode | Controlled / initial prop | Change event |
|---|---|---|
single | value / defaultValue: YYYY-MM-DD | onValueChange({ value }) |
multiple | values / defaultValues: readonly string[] | onValuesChange({ values }) |
range | range / defaultRange: { from?, to? } | onRangeChange({ range }) |
Examples
Section titled “Examples”A default single-date calendar with a plain month heading.
<proto-ui-brutalist-calendar-root id="calendar-basic">
<proto-ui-brutalist-calendar-caption>
<proto-ui-brutalist-calendar-previous
aria-label="Previous month"
>
‹
</proto-ui-brutalist-calendar-previous>
<proto-ui-brutalist-calendar-heading></proto-ui-brutalist-calendar-heading>
<proto-ui-brutalist-calendar-next aria-label="Next month">
›
</proto-ui-brutalist-calendar-next>
</proto-ui-brutalist-calendar-caption>
<proto-ui-brutalist-calendar-grid>
<proto-ui-brutalist-calendar-weekdays>
<!-- 7 Weekday slots with offset 0..6 -->
</proto-ui-brutalist-calendar-weekdays>
<!-- 6 Row slots (index 0..5), each with 7 Day slots (offset 0..41) -->
</proto-ui-brutalist-calendar-grid>
</proto-ui-brutalist-calendar-root>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
setElementProps(document.querySelector('#calendar-basic'), {
mode: 'single',
defaultMonth: '2026-10',
defaultValue: '2026-10-12',
today: '2026-10-08',
});
</script>Set mode="range" for joined range endpoints and continuous span shading.
<proto-ui-brutalist-calendar-root id="calendar-range">
<proto-ui-brutalist-calendar-caption>
<proto-ui-brutalist-calendar-previous
aria-label="Previous month"
>
‹
</proto-ui-brutalist-calendar-previous>
<proto-ui-brutalist-calendar-heading></proto-ui-brutalist-calendar-heading>
<proto-ui-brutalist-calendar-next aria-label="Next month">
›
</proto-ui-brutalist-calendar-next>
</proto-ui-brutalist-calendar-caption>
<proto-ui-brutalist-calendar-grid>
<proto-ui-brutalist-calendar-weekdays>
<!-- 7 Weekday slots with offset 0..6 -->
</proto-ui-brutalist-calendar-weekdays>
<!-- 6 Row slots (index 0..5), each with 7 Day slots (offset 0..41) -->
</proto-ui-brutalist-calendar-grid>
</proto-ui-brutalist-calendar-root>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
setElementProps(document.querySelector('#calendar-range'), {
mode: 'range',
defaultMonth: '2026-10',
defaultRange: { from: '2026-10-08', to: '2026-10-16' },
today: '2026-10-04',
});
</script>Multiple and range selection
Section titled “Multiple and range selection”Combine min, max, unavailable, minNights, maxNights, and maxSelected to constrain selections.
<div class="flex flex-wrap items-start gap-8">
<proto-ui-brutalist-calendar-root id="calendar-range-constrained">
<!-- Range (1–14 nights) -->
</proto-ui-brutalist-calendar-root>
<proto-ui-brutalist-calendar-root id="calendar-multiple">
<!-- Multiple (max 4 dates) -->
</proto-ui-brutalist-calendar-root>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
setElementProps(
document.querySelector('#calendar-range-constrained'),
{
mode: 'range',
defaultMonth: '2026-10',
defaultRange: { from: '2026-10-10', to: '2026-10-14' },
min: '2026-10-01',
max: '2026-11-30',
unavailable: ['2026-10-18'],
minNights: 1,
maxNights: 14,
}
);
setElementProps(document.querySelector('#calendar-multiple'), {
mode: 'multiple',
defaultMonth: '2026-10',
defaultValues: ['2026-10-03', '2026-10-08', '2026-10-12'],
min: '2026-10-01',
max: '2026-11-30',
unavailable: ['2026-10-18'],
maxSelected: 4,
});
</script>Presets
Section titled “Presets”Pair controlled value, month, and fixedWeeks with family Button presets.
<div class="inline-flex flex-col items-center gap-3">
<proto-ui-brutalist-calendar-root id="calendar-presets">
<!-- Caption + 6-week fixed Grid -->
</proto-ui-brutalist-calendar-root>
<div class="flex max-w-[300px] flex-wrap gap-2">
<proto-ui-brutalist-button data-offset="0">
Today
</proto-ui-brutalist-button>
<proto-ui-brutalist-button data-offset="1">
Tomorrow
</proto-ui-brutalist-button>
<proto-ui-brutalist-button data-offset="3">
In 3 days
</proto-ui-brutalist-button>
<proto-ui-brutalist-button data-offset="7">
In a week
</proto-ui-brutalist-button>
<proto-ui-brutalist-button data-offset="14">
In 2 weeks
</proto-ui-brutalist-button>
</div>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const root = document.querySelector('#calendar-presets');
setElementProps(root, {
fixedWeeks: true,
value: '2026-10-12',
month: '2026-10',
today: '2026-10-10',
});
</script>Booked dates
Section titled “Booked dates”Use unavailable along with min and max to block booked date ranges.
<proto-ui-brutalist-calendar-root id="calendar-booked">
<!-- Caption + Grid -->
</proto-ui-brutalist-calendar-root>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
setElementProps(document.querySelector('#calendar-booked'), {
defaultMonth: '2026-10',
defaultValue: '2026-10-06',
today: '2026-10-06',
min: '2026-10-01',
max: '2026-10-31',
unavailable: [
'2026-10-12',
'2026-10-13',
'2026-10-14',
'2026-10-15',
'2026-10-16',
'2026-10-17',
'2026-10-18',
'2026-10-19',
'2026-10-20',
],
});
</script>Set direction="rtl", locale="ar-SA", and weekStartsOn={6} for RTL layout and mirrored navigation.
<proto-ui-brutalist-calendar-root id="calendar-rtl">
<!-- Caption + Grid -->
</proto-ui-brutalist-calendar-root>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
setElementProps(document.querySelector('#calendar-rtl'), {
defaultMonth: '2026-10',
defaultValue: '2026-10-12',
today: '2026-10-08',
locale: 'ar-SA',
direction: 'rtl',
weekStartsOn: 6,
a11yLabel: 'اختر تاريخاً',
});
</script>| Prop | Type | Default |
|---|---|---|
mode | 'single' 'multiple' 'range' | 'single' |
value | string | undefined |
defaultValue | string | '' |
values | readonly string[] | undefined |
defaultValues | readonly string[] | [] |
range | CalendarRange | undefined |
defaultRange | CalendarRange | {} |
minSelected | number | 0 |
maxSelected | number | undefined |
minNights | number | 0 |
maxNights | number | undefined |
month | string | undefined |
defaultMonth | string | undefined |
min | string | '' |
max | string | '' |
unavailable | readonly string[] | [] |
disabled | boolean | false |
readOnly | boolean | false |
weekStartsOn | number | 0 |
fixedWeeks | boolean | false |
a11yLabel | string | 'Calendar' |
today | string | '' |
locale | string | 'en-US' |
direction | 'ltr' 'rtl' | 'ltr' |
Sub-part props
Section titled “Sub-part props”| Part / Prop | Type | Default |
|---|---|---|
Day.date | string | '' |
Day.offset | number | 0 |
Day.disabled | boolean | false |
Row.index | number | undefined |
Weekday.offset | number | 0 |
Caption.a11yLabel | string | 'Calendar navigation' |
Previous / Next.a11yLabel | string | 'Previous month' / 'Next month' |
Previous / Next.disabled | boolean | false |
Events, methods, and exposed states
Section titled “Events, methods, and exposed states”- Events (Root):
onValueChange({ value }),onValuesChange({ values }),onRangeChange({ range }),onMonthChange({ month }). - Methods (Root):
requestValue(date),requestValues(dates),requestRange(range),requestMonth(month),getValues(),getRange(). - Exposed states: Root exposes
value,mode,selectedCount,rangeComplete,month,weekCount,disabled,direction; Day exposesdate,selected,rangeStart,rangeEnd,rangeMiddle,rangePending,today,outside,disabled,hidden.