Components
Blinds reveal
Content behind a row of slats that fold away one after another as the block scrolls into view, or when told to. Alternate slats fold to opposite edges, and the content underneath settles from a touch larger.
pnpm dlx shadcn@latest add @caliper/blinds-revealWhen to use
Use it for
- Hero images, feature screenshots and photo cards on landing pages.
- A reveal you can replay from a button, such as a before and after.
Skip it when
- Text people need at once; the cover hides it for about a second.
- Long lists or many blocks in one view.
Decisions
Why it is built this way, so you know what to keep when you change your copy.
Behaviour
- Opens once in view
- It watches itself and opens a quarter of the way in; set
revealedto drive it yourself and replay it.
Usage
- Always in the document
- The slats are a visual cover only, so the content is read from the start, and the slats never take pointer input.
- No cover under reduced motion
- The slats are not drawn and the content simply appears.
Installation
pnpm dlx shadcn@latest add @caliper/blinds-reveal
Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. No account needed. The first part also adds Caliper UI’s tokens; import them once as in Installation.
Usage
This is the code behind the preview above.
import { useState, type ReactNode } from "react" import { BlindsReveal } from "@/components/ui/blinds-reveal" import { Button } from "@/components/ui/button" function Panel({ title, context, className = "max-w-md", children }: { title: string; context: string; className?: string; children: ReactNode }) { return ( <section className={`grid w-full gap-5 rounded-overlay border border-border bg-background p-6 shadow-resting max-sm:p-4 ${className}`}> <div className="grid gap-1"> <p className="font-medium">{title}</p> <p className="text-sm text-muted-foreground">{context}</p> </div> {children} </section> ); } export function BlindsRevealDemo() { const [shown, setShown] = useState(true); const [run, setRun] = useState(0); return ( <Panel title="Photo card" context="Slats fold away in turn. Replay it." className="max-w-lg"> <BlindsReveal key={run} revealed={shown} slats={9} className="overflow-hidden rounded-control"> <img src="/media/harbour.jpg" alt="A harbour at dawn with moored boats" className="aspect-[16/9] w-full object-cover" /> </BlindsReveal> <div className="flex gap-2"> <Button variant="secondary" size="sm" onClick={() => { setShown(false); setRun((value) => value + 1); requestAnimationFrame(() => requestAnimationFrame(() => setShown(true))); }} > Replay </Button> </div> </Panel> ); }
API reference
BlindsReveal
component
Also accepts the native props of its root element and a ref.
Accessibility
It is built on native elements and keeps aria-hidden in step with state.
No custom key handling; Tab and the native activation keys do the work.
Motion
It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.
Related
- Clip revealUncovers an image or section with a wipe as it scrolls into view, the content settling from a slight zoom behind the edge. From any side or as an iris from the middle, once or every time.
- Pixel revealSwaps content behind a wave of square tiles: they cover the old view corner to corner, the content changes while hidden, and the tiles clear the same way. Change the key to run it; the whole wave is about half a second.
- Reveal lensTwo layers in one frame and a round lens that shows the second through the first. The lens trails the pointer on a spring, opens wider while pressed and closes when the pointer leaves.
