Mini Calendar
A compact horizontal strip of selectable days with previous/next navigation, ideal as a space-efficient date picker for toolbars, popovers, and inline forms.
Install
Pull Mini Calendar from the barrel for everyday use, or the granular path when you want a tighter bundle.
import { MiniCalendar } from "@brika/clay";import { MiniCalendar } from "@brika/clay/components/mini-calendar";A minimal example
Drop this into a page. Native HTML attributes pass through to the underlying primitive.
'use client';
import {
MiniCalendar,
MiniCalendarDay,
MiniCalendarDays,
MiniCalendarNavigation,
} from '@brika/clay/components/mini-calendar';
import { useState } from 'react';
/** A five-day strip with prev/next navigation; selection is controlled. */
export default function MiniCalendarDefaultDemo() {
const [date, setDate] = useState<Date>(() => new Date());
return (
<div className="space-y-3">
<MiniCalendar value={date} onValueChange={setDate}>
<MiniCalendarNavigation direction="prev" />
<MiniCalendarDays>{(day) => <MiniCalendarDay date={day} />}</MiniCalendarDays>
<MiniCalendarNavigation direction="next" />
</MiniCalendar>
<p className="text-clay-subtle text-xs">
Selected:{' '}
{date.toLocaleDateString(undefined, {
weekday: 'long',
month: 'long',
day: 'numeric',
year: 'numeric',
})}
</p>
</div>
);
}Mini Calendar, every way
Accessibility
- The strip is wrapped in
role="group"with anaria-labelso assistive tech announces it as a single date picker. - Day cells are real
<button>s, keyboard-focusable with Enter/Space activating selection. - Each day carries
aria-pressedand a localizedaria-label(e.g. "Monday, June 8, 2026"); nav buttons are labelled "Previous days" / "Next days". - Weekday and day labels are formatted with
Intl.DateTimeFormat, so alocaleprop localizes the visible text for assistive tech too.
Theme tokens
Every CSS variable Mini Calendar reads, with its default and the
dotted path you'd write in a ThemeConfig JSON
to override it. Set any of these in your theme to retune Mini Calendar
without touching component code.
Mini Calendar tokens
8 tokens--mini-calendar-day-labelcolorvar(--foreground)components.miniCalendar.dayLabelDay-number text color at rest.
--mini-calendar-weekdaycolorvar(--muted-foreground)components.miniCalendar.weekdayWeekday-abbreviation text color at rest.
--mini-calendar-day-hovercolorvar(--accent)components.miniCalendar.dayHoverDay cell background on hover.
--mini-calendar-day-selectedcolorvar(--primary)components.miniCalendar.daySelectedSelected day cell background.
--mini-calendar-day-selected-labelcolorvar(--primary-foreground)components.miniCalendar.daySelectedLabelSelected day cell text color.
--mini-calendar-radiusradiusvar(--radius-control)components.miniCalendar.radiusCorner radius of a day cell.
--mini-calendar-durationdurationvar(--motion-standard-duration)components.miniCalendar.durationTransition duration for mini-calendar state changes.
--mini-calendar-easingeasingvar(--motion-standard-easing)components.miniCalendar.easingTransition easing for mini-calendar state changes.
Override in a theme
Authoring a theme is plain JSON. Drop overrides under
components.miniCalendar, the names
are camelCase versions of the variable suffix.
{
"id": "my-theme",
"name": "My Theme",
"description": "...",
"accentSwatches": ["#000"],
"components": {
"miniCalendar": {
"radius": "var(--radius-control)"
}
}
}
Then apply with applyTheme(myTheme)
(see the theming guide),
scope it to a subtree with themeToCssVars(myTheme, mode),
or consume any token directly in your own JSX with the matching Tailwind utility
(e.g. bg-mini-calendar-…) — see the
chips on each token row.
API reference
Props specific to Mini Calendar. Native HTML attributes pass through to the underlying primitive, see the component source on GitHub for the full type signature.
<MiniCalendar />
8 props- daysdefault
5numberNumber of days shown at once. Defaults to5. - DateLeft-most visible date on first render (uncontrolled).
- DateSelected date on first render (uncontrolled).
- Intl.LocalesArgumentBCP 47 locale(s) used to format the weekday, day number, and accessible label via
Intl.DateTimeFormat. Defaults to the runtime's locale. - (date: Date) => voidFires with the new range start when the user navigates.
- (date: Date) => voidFires with the newly selected date.
- DateLeft-most visible date (controlled). Pair with
onStartDateChange. - DateSelected date (controlled). Pair with
onValueChange.
<MiniCalendarContext />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<MiniCalendarDay />
1 prop- DateThe date this cell represents.
<MiniCalendarDays />
1 prop- string
No description.
<MiniCalendarNavigation />
1 prop- 'prev' | 'next'Which way the strip moves when pressed.