Keyframery

Calendar

One key glides from the old day to the new one, and weeks slide in from the side you turned to.

See it as an AI agent does.

Resize preview. Focus the handle and use the left or right arrow keys. Hold Shift for larger steps.— px
Customize1 controls
Animation speed1×

Installation

npx shadcn@latest add @keyframery/calendar

This adds components/keyframery/calendar.tsx and its primitive to your project, and installs UI SDK. The motion tokens are added to your global CSS the first time you install a component.

Usage

import { Calendar, CalendarGrid, CalendarHeader, CalendarHeading, CalendarNext, CalendarPrevious } from "@/components/keyframery/calendar"

export default function Usage() {
  return (
    <Calendar aria-label="Date">
      <CalendarHeader>
        <CalendarPrevious />
        <CalendarHeading />
        <CalendarNext />
      </CalendarHeader>
      <CalendarGrid />
    </Calendar>
  )
}

Next.js with cacheComponents

The calendar reads today's date while it renders. With cacheComponents turned on, render it inside <Suspense> after await connection(). See the fix.

Anatomy

How the parts fit together:

Calendar
├── CalendarHeader
│   ├── CalendarPrevious
│   ├── CalendarHeading
│   └── CalendarNext
└── CalendarGrid

Examples

One date

Dates are ISO strings, like "2026-06-12", so they need no conversion to store or send.

Range

mode="range" picks a start and an end. minDays and maxDays limit how long it can be.

Limits and unavailable days

min and max bound the dates. unavailable takes dates, ranges, weekdays or a before or after date.

Two months

months={2} shows two side by side. Without children, the calendar lays out its header and a grid for each month.

Motion

MoveWhat you see
GlideOne key glides from the old selected day to the new one.
DirectionWeeks slide in from the side you turned to.
PressDays and arrows press in.

Timing and springiness follow the motion style you set. To change how fast this calendar moves, pass speed:

<Calendar speed="fast">
  …
</Calendar>

"fast" is 0.6×, "slow" 1.4×, and a number sets the multiplier. With reduced motion turned on, nothing moves: changes happen at once or with a short fade.

Theming

Set these CSS variables on the component or a parent. Leave them unset to follow the light and dark theme. The open Customize panel below the preview lets you try these settings.

VariableWhat it changesDefault
--calendar-faceCalendar surface--card
--calendar-inkCalendar body and day text--card-foreground / --foreground
--calendar-accentSelected day keys--primary
--calendar-radiusCalendar corners14px
--calendar-sizeDay cell size and weekday width2rem
--calendar-gapVertical day row spacing0.125rem

API reference

Every part takes className and children. Parts from UI SDK also take render, to draw your own element, and a function of their state for className and style. Props not listed here are in the UI SDK calendar reference.

Calendar

Renders a <div>, and takes its props too.

Prop

Type

Other parts

These take the props of the element they render, and nothing else:

  • CalendarHeader: a <div>
  • CalendarPrevious: a <button>
  • CalendarHeading: a <h2>
  • CalendarNext: a <button>
  • CalendarGrid: a <table>
  • CalendarDay: a <tabledatacell>
  • CalendarMonthSelect: a <select>
  • CalendarWeekday: a <tableheadercell>
  • CalendarWeekdays: a <tbody>
  • CalendarWeeks: a <tbody>
  • CalendarYearSelect: a <select>

Keyboard

KeyWhat it does
← →Moves a day back or forward.
↑ ↓Moves a week back or forward.
Page UpMoves to the previous month.
Page DownMoves to the next month.
HomeMoves to the start of the week.
EndMoves to the end of the week.
EnterSelects the focused day.

Accessibility

Keyboard, focus and screen-reader behaviour come from UI SDK and are not changed. More in Accessibility.

Swap the import

Already using UI SDK's calendar with your own styles? Keep your markup and change one line. The primitive adds motion and nothing else.

// Before
import { … } from "@ui-sdk/react/calendar"

// After: same parts, same props, now animated
import { … } from "@/components/keyframery/primitives/calendar"

Questions

How does the animated Calendar for UI SDK move?

Glide: One key glides from the old selected day to the new one. Direction: Weeks slide in from the side you turned to. Press: Days and arrows press in.

Do I need Motion or Framer Motion for the animated Calendar?

No. Every move is plain CSS, so there is nothing to install besides the component and UI SDK.

Can I keep my own styling and only take the motion?

Yes. Import from @/components/keyframery/primitives/calendar instead. It has the same parts and props as @ui-sdk/react/calendar and adds motion only.

What happens to the Calendar when someone turns on reduced motion?

Nothing moves. State changes happen at once, or with a short fade.

All components

On this page