Calendar
React + Tailwind
const css = `
.cb-calendar { position: relative; display: inline-flex; align-items: center; gap: 12px; color: light-dark(#42454c, #e5e6e9); font-size: 14px; cursor: pointer; user-select: none; }
.cb-calendar__input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.cb-calendar__pad { position: relative; width: 34px; height: 38px; perspective: 140px; }
.cb-calendar__input:focus-visible + .cb-calendar__pad { outline: 2px solid light-dark(#5f626a, #a7abb2); outline-offset: 3px; border-radius: 6px; }
.cb-calendar__sheet {
position: absolute;
left: 0;
right: 0;
top: 6px;
bottom: 0;
display: grid;
place-items: center;
border-radius: 0 0 6px 6px;
font-weight: 600;
line-height: 1;
}
.cb-calendar__sheet--under { align-content: start; padding-top: 5px; background: light-dark(#ebedf0, #232529); box-shadow: inset 0 0 0 1px light-dark(#cbced3, #393c41); color: light-dark(#5f626a, #a7abb2); font-size: 7px; letter-spacing: 0.12em; }
.cb-calendar__sheet--page {
align-content: center;
gap: 2px;
background: light-dark(#dbdde1, #2e3035);
box-shadow: inset 0 0 0 1px light-dark(#6d7179, #7d8087);
color: light-dark(#373a40, #f1f2f3);
font-size: 14px;
transform-origin: 50% 0;
backface-visibility: hidden;
transition: transform 0.5s cubic-bezier(0.3, 1.4, 0.5, 1), opacity 0s linear 0s;
}
.cb-calendar__month { color: light-dark(#50535b, #c6c8cd); font-size: 7px; letter-spacing: 0.12em; }
.cb-calendar__stamp { position: absolute; left: 0; top: 6px; width: 34px; height: 26px; transform: scale(0.4); opacity: 0; transition: transform 0.15s, opacity 0.15s; }
.cb-calendar__stamp path { fill: none; stroke: light-dark(#373a40, #f1f2f3); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cb-calendar__bind {
position: absolute;
left: 0;
right: 0;
top: 0;
height: 8px;
border-radius: 5px 5px 1px 1px;
background: light-dark(#6d7179, #7d8087);
z-index: 1;
}
.cb-calendar__ring { position: absolute; top: -3px; width: 3px; height: 7px; border-radius: 2px; background: light-dark(#50535b, #c6c8cd); }
.cb-calendar__input:checked + .cb-calendar__pad .cb-calendar__sheet--page { transform: rotateX(130deg); transition: transform 0.45s cubic-bezier(0.5, 0, 0.3, 1); }
.cb-calendar__input:checked + .cb-calendar__pad .cb-calendar__stamp { transform: none; opacity: 1; transition: transform 0.35s cubic-bezier(0.3, 1.8, 0.5, 1) 0.25s, opacity 0.1s ease 0.25s; }
@media (prefers-reduced-motion: reduce) {
.cb-calendar__pad * { transition-duration: 0.01s !important; transition-delay: 0s !important; }
}
`;
export function CalendarCheckbox() {
return (
<>
<style>
{css}
</style>
<label className="cb-calendar">
<input className="cb-calendar__input" type="checkbox" />
<span className="cb-calendar__pad" aria-hidden="true">
<span className="cb-calendar__sheet cb-calendar__sheet--under">
OCT 26
<svg className="cb-calendar__stamp" viewBox="0 0 34 26">
<path d="M10 13.5L15 18.5L24.5 7.5" />
</svg>
</span>
<span className="cb-calendar__sheet cb-calendar__sheet--page">
<span className="cb-calendar__month">OCT</span>
26
</span>
<span className="cb-calendar__bind">
<span className="cb-calendar__ring" style={{ left: 8 }} />
<span className="cb-calendar__ring" style={{ right: 8 }} />
</span>
</span>
Mark today done
</label>
</>
);
}Markup where the component goes, CSS in your stylesheet. No JavaScript.
HTML
<label class="cb-calendar"><input class="cb-calendar__input" type="checkbox"/><span class="cb-calendar__pad" aria-hidden="true"><span class="cb-calendar__sheet cb-calendar__sheet--under">OCT 26<svg class="cb-calendar__stamp" viewBox="0 0 34 26"><path d="M10 13.5L15 18.5L24.5 7.5"></path></svg></span><span class="cb-calendar__sheet cb-calendar__sheet--page"><span class="cb-calendar__month">OCT</span>26</span><span class="cb-calendar__bind"><span class="cb-calendar__ring" style="left:8px"></span><span class="cb-calendar__ring" style="right:8px"></span></span></span>Mark today done</label>CSS
.cb-calendar { position: relative; display: inline-flex; align-items: center; gap: 12px; color: light-dark(#42454c, #e5e6e9); font-size: 14px; cursor: pointer; user-select: none; }
.cb-calendar__input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.cb-calendar__pad { position: relative; width: 34px; height: 38px; perspective: 140px; }
.cb-calendar__input:focus-visible + .cb-calendar__pad { outline: 2px solid light-dark(#5f626a, #a7abb2); outline-offset: 3px; border-radius: 6px; }
.cb-calendar__sheet {
position: absolute;
left: 0;
right: 0;
top: 6px;
bottom: 0;
display: grid;
place-items: center;
border-radius: 0 0 6px 6px;
font-weight: 600;
line-height: 1;
}
.cb-calendar__sheet--under { align-content: start; padding-top: 5px; background: light-dark(#ebedf0, #232529); box-shadow: inset 0 0 0 1px light-dark(#cbced3, #393c41); color: light-dark(#5f626a, #a7abb2); font-size: 7px; letter-spacing: 0.12em; }
.cb-calendar__sheet--page {
align-content: center;
gap: 2px;
background: light-dark(#dbdde1, #2e3035);
box-shadow: inset 0 0 0 1px light-dark(#6d7179, #7d8087);
color: light-dark(#373a40, #f1f2f3);
font-size: 14px;
transform-origin: 50% 0;
backface-visibility: hidden;
transition: transform 0.5s cubic-bezier(0.3, 1.4, 0.5, 1), opacity 0s linear 0s;
}
.cb-calendar__month { color: light-dark(#50535b, #c6c8cd); font-size: 7px; letter-spacing: 0.12em; }
.cb-calendar__stamp { position: absolute; left: 0; top: 6px; width: 34px; height: 26px; transform: scale(0.4); opacity: 0; transition: transform 0.15s, opacity 0.15s; }
.cb-calendar__stamp path { fill: none; stroke: light-dark(#373a40, #f1f2f3); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cb-calendar__bind {
position: absolute;
left: 0;
right: 0;
top: 0;
height: 8px;
border-radius: 5px 5px 1px 1px;
background: light-dark(#6d7179, #7d8087);
z-index: 1;
}
.cb-calendar__ring { position: absolute; top: -3px; width: 3px; height: 7px; border-radius: 2px; background: light-dark(#50535b, #c6c8cd); }
.cb-calendar__input:checked + .cb-calendar__pad .cb-calendar__sheet--page { transform: rotateX(130deg); transition: transform 0.45s cubic-bezier(0.5, 0, 0.3, 1); }
.cb-calendar__input:checked + .cb-calendar__pad .cb-calendar__stamp { transform: none; opacity: 1; transition: transform 0.35s cubic-bezier(0.3, 1.8, 0.5, 1) 0.25s, opacity 0.1s ease 0.25s; }
@media (prefers-reduced-motion: reduce) {
.cb-calendar__pad * { transition-duration: 0.01s !important; transition-delay: 0s !important; }
}Goal: Create a "Calendar" checkbox.
Visual behavior: A tear-off calendar checkbox: ticking flips today's page up over the binding to show the day ticked off underneath; unticking flips it back down.
Technique:
- A real native checkbox (visually hidden: absolute, 1x1, opacity 0) inside a <label>; every visual is aria-hidden and styled from the input with :checked + sibling selectors.
- The page is hinged at its top edge in a perspective box and turns with rotateX; backface-visibility hides it once it has turned past the binding.
- The tick on the page beneath springs in after a delay. Pure CSS, no script.
Accessibility: A native checkbox inside a <label>, so Space toggles it and the visible label names it; :focus-visible on the input outlines the visual. Under prefers-reduced-motion the page changes instantly.
My stack: {{USER_STACK}}
My styling: {{USER_STYLING}}
My constraints: {{USER_CONSTRAINTS}}
My colors: neutral only. Black, white and grays, no hues. Use the color values above as written, or my project's closest neutral tokens.
Return a single self-contained component. No dependencies.Goal: Create a "Calendar" checkbox.
Visual behavior: A tear-off calendar checkbox: ticking flips today's page up over the binding to show the day ticked off underneath; unticking flips it back down.
Technique:
- A real native checkbox (visually hidden: absolute, 1x1, opacity 0) inside a <label>; every visual is aria-hidden and styled from the input with :checked + sibling selectors.
- The page is hinged at its top edge in a perspective box and turns with rotateX; backface-visibility hides it once it has turned past the binding.
- The tick on the page beneath springs in after a delay. Pure CSS, no script.
Accessibility: A native checkbox inside a <label>, so Space toggles it and the visible label names it; :focus-visible on the input outlines the visual. Under prefers-reduced-motion the page changes instantly.
My stack: {{USER_STACK}}
My styling: {{USER_STYLING}}
My constraints: {{USER_CONSTRAINTS}}
My colors: use my project's existing color tokens. The color values above are grayscale placeholders. Map each one by its role (surface, text, border, accent, glow) to my theme, and keep their relative lightness so contrast and the effect still read.
Return a single self-contained component. No dependencies.Paste into Claude, ChatGPT or Cursor after filling in {{USER_STACK}}, {{USER_STYLING}} and {{USER_CONSTRAINTS}}. Neutral keeps the greys you see here; Match my project asks the model to map them onto your own colour tokens.
Free to use in any project, commercial included. MIT-0, no attribution required. Licence
About this component
A tear-off calendar checkbox: ticking flips today's page up over the binding to show the day ticked off underneath; unticking flips it back down.
- Dependencies
- None
- Difficulty
- Beginner
- Triggers
- click, state change, 3d
- Techniques
- perspective, 3d transform, css transition
- Reduced motion
- Respected
- Theme
- Light and dark (follows your page's color-scheme)
A native checkbox inside a <label>, so Space toggles it and the visible label names it; :focus-visible on the input outlines the visual. Under prefers-reduced-motion the page changes instantly.