Skip to content
caliper ui docs

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.

Free
pnpm dlx shadcn@latest add @caliper/blinds-reveal

Photo card

Slats fold away in turn. Replay it.

A harbour at dawn with moored boats
Installs components/ui/blinds-reveal.tsxDepends on none beyond ReactMotion none in component source

When 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 revealed to 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

terminal
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.

example.tsx
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.

PropTypeDefaultDescription
revealedboolean—Controlled state. Leave unset to open once the block scrolls into view.
slatsnumber8Number of slats, 2 to 16. Two is a pair of curtains.
direction"horizontal" | "vertical""vertical"Which way the slats run.

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.

All Media examples