Peel Reveal
ComponentsPeel Reveal
ExperimentsNew

Peel Reveal

A little curiosity goes a long way. Peel back a paper corner to discover what’s underneath.

React + CSS
Pull the bottom-right corner inward, or activate the cover to reveal its contents.
Live component. Go ahead, interact.
01

Installation

Run this in your shadcn-configured React project. The component and stylesheet are added together.

TERMINAL
npx shadcn@latest add http://localhost:5173/r/peel-reveal.json

This command uses the current site address. For localhost, keep this preview running on the same computer. Files follow your configured components alias.

02

Usage

Import the component and make the details your own.

TypeScript
import { PeelReveal } from '@/components/anticraft/PeelReveal';

export function Example() {
  return (
    <PeelReveal
      label="Discover the other side"
      front={<span style={{ display: 'grid', placeItems: 'center', height: '100%', background: '#ea7852', fontSize: 48 }}>Stay curious. ↗</span>}
    >
      <div style={{ padding: 32, background: '#dce9b5', height: '100%' }}>
        <h2>There’s more to the story.</h2>
        <p>A hidden message, project detail, or next idea.</p>
      </div>
    </PeelReveal>
  );
}
03

Props

PropTypeDefaultDescription
frontReactNodeRequiredDecorative artwork on the paper surface. Keep links and other controls in the revealed content.
childrenReactNodeRequiredThe content underneath. Links and buttons become available when the paper is open.
labelstring'Peel to reveal'An accessible label for the reveal control.
defaultOpenbooleanfalseWhether the paper starts peeled away.
onOpenChange(open: boolean) => voidundefinedCalled when the open state changes.
classNamestring''Additional classes. Set --ac-peel-height to size the card.
04

Motion & accessibility

Considered by default.

Drag the corner, or click, tap, or press Enter on the front to reveal the content. A dedicated corner handle preserves ordinary touch scrolling on the rest of the surface. Close restores the paper. Hidden content stays out of the focus order. Reduced motion removes the animated snap.

Use semantic content and meaningful labels in your composition. Check contrast and keyboard behavior with your own styles and content.