A sheet of die-cut doors that open one per day: each door lifts toward the hand, swings on its hinge and shows a lit well with the day's content.
Press mePress me
Torrefazione Alba · Account
24 coffees, one a day
12 of 24 opened
Huila250 g
Sidama250 g
Cerrado250 g
Kayanza250 g
Antigua250 g
Tarrazú250 g
Limu250 g
Caldas250 g
Kirinyaga250 g
Santos250 g
Nariño250 g
15%code below
Door 14 · today
15% off your next bag
ALBA-15
advent-calendar · , lively
advent-calendar-demo.tsx
When to use
Use it for content that really changes once a day in December. The app passes today's date and stores which doors were opened; closed doors render no content, so nothing leaks early.
When not to use
For a single deadline use Countdown. For content that is not tied to one-per-day dates, a plain grid of cards is simpler.
Use it for something that really changes once a day in December: a daily offer for members, a
product drop, a changelog that ships one fix every morning. The doors are the content's calendar,
so the app owns the dates and remembers who opened what. For a single deadline, use countdown.
One sheet of card, die-cut into balls, tiles, arches and pills of different sizes, with the
numbers out of order as on a printed calendar. Hover an available door and its free edge lifts
toward the hand while a line of light from the well shows along the gap. Press: the flap sinks
into the sheet and its shadow tightens, swings open with weight, bounces once on its stop and
rests at 104 degrees with its lighter back facing you. The well behind it is sunk in the sheet and
lit warm from inside; opening never moves a neighbour. Today's door rests 2 degrees ajar, still.
today is the app's today, as a Date (read in the device's zone) or a "YYYY-MM-DD" string.
The component never reads the clock, so the server and the client render the same doors. Doors
before today stay openable (a missed day is not lost), doors after it are locked until their
day: they do not lift, answer a press with a 1 px "no", call onLockedPress and show a tooltip
("Opens 14 December").
// Pick whose day it is on the server, per request (not from a cached page)…const today = new Intl.DateTimeFormat("en-CA", { timeZone: "Europe/Rome" }).format(new Date())// …or on the client after mount, for the visitor's own day.
opened is a list of day keys ("2026-12-14"). Store it per person and pass it back: the
calendar is controlled. Without opened it keeps its own list from defaultOpened.
onOpen(door) runs once per opened door, ready for analytics or for showing the full offer in a
panel next to the calendar, as the demos do. Content behind closed doors is not rendered at all,
so nothing leaks into the page before its day.
preset changes the cut of the sheet and the hinge, not only the motion:
hinge (default): balls, tiles, arches and pills; side-hinged flaps swing to the left.
shutter: a tall cut of arches and columns; each door parts in two halves from its centre.
lift: dog-eared tiles and balls; the flap peels from its lower corner and stays curled.
Set the character with temperament (calm, lively, playful) or MotionKitProvider: it
changes the swing's weight and bounce only. calm keeps the sink and the swing, without bounce.
The account page of an invented roaster, "24 coffees, one a day": two missed doors are still
closed, today's door holds a 15% code that appears with a copy button under the calendar.
A product team's "24 fixes of December" inside a dashboard panel with the shutter preset.
Today's door rests ajar; a locked door says in a polite line when its fix ships.
The doors are a list named by labels.calendar. Each door is a real button with a name that
says the number and the date ("Open door 14, 14 December, today"); opened doors add their
label.
Available doors carry aria-expanded and aria-controls their well. Locked doors carry
aria-disabled and the opening date in their name, and their tooltip repeats it on hover,
focus, tap or long press.
An opened door keeps its focus and name but lets pointer clicks through to its content, so a
copy button or a link inside the well works.
Flaps, backs and the line of light are aria-hidden and take no pointer. Locked numbers use
muted-foreground, which stays AA on the card. Doors are 44 px or more at 320 px.
Every string is in labels and dates follow locale (Intl, computed in UTC so the server
and client agree).
Motion only: CSS 3D transforms (perspective, rotate3d) and opacity, no canvas. Each door
runs a spring while it moves and stops at rest; nothing loops, so there is nothing to pause off
screen.
The grid is CSS: square cells from the sheet's width with container queries, three columns
under 28rem, four up to 42rem, six above. Wells are part of the sheet, so opening never causes
layout.