Scratch Reveal
Scratch reveal hover panel: painted paint wears away on hover to expose a pencil construction sketch, with the label switching to the canvas ink. Paint, canvas, sketch and ink default to theme colors; decorative, and reduced motion skips the fade.
The source comes with full access.
One payment of $149 opens the source right here and lets the CLI install every paid component, with lifetime updates.
Installation
pnpm dlx shadcn@latest add @01orbital/scratch-revealnpx shadcn@latest add @01orbital/scratch-revealyarn dlx shadcn@latest add @01orbital/scratch-revealbunx --bun shadcn@latest add @01orbital/scratch-revealUsage
import { ScratchReveal } from "@/components/graphics/scratch-reveal"
// Every word on the page. Change copy here, not in the markup.
const COPY = {
label: "Under the surface",
} as const
export default function ScratchRevealDemo() {
return <ScratchReveal>{COPY.label}</ScratchReveal>
}This example installs with everything it uses:
pnpm dlx shadcn@latest add @01orbital/scratch-reveal-demonpx shadcn@latest add @01orbital/scratch-reveal-demoyarn dlx shadcn@latest add @01orbital/scratch-reveal-demobunx --bun shadcn@latest add @01orbital/scratch-reveal-demoExamples
Project Briefscratch-reveal-project-brief
Portfolio project card example showing ScratchReveal: a reveal panel above the story, a serif heading and a folded brief.
The source comes with full access.
One payment of $149 opens the source right here and lets the CLI install every paid component, with lifetime updates.
pnpm dlx shadcn@latest add @01orbital/scratch-reveal-project-briefnpx shadcn@latest add @01orbital/scratch-reveal-project-briefyarn dlx shadcn@latest add @01orbital/scratch-reveal-project-briefbunx --bun shadcn@latest add @01orbital/scratch-reveal-project-briefPaper Stockscratch-reveal-paper-stock
Stock card example showing ScratchReveal: a letterpress paper stock card on deep teal with a reveal swatch and a specification list.
The source comes with full access.
One payment of $149 opens the source right here and lets the CLI install every paid component, with lifetime updates.
pnpm dlx shadcn@latest add @01orbital/scratch-reveal-paper-stocknpx shadcn@latest add @01orbital/scratch-reveal-paper-stockyarn dlx shadcn@latest add @01orbital/scratch-reveal-paper-stockbunx --bun shadcn@latest add @01orbital/scratch-reveal-paper-stockAPI reference
A painted panel, 240 by 100px by default, with its children as a label. On hover the paint wears away to a pencil construction sketch and the label switches to the canvas ink.
Its colors are CSS variables you can set with className, each defaulting to a theme color: --scratch-paint and --scratch-paint-to (the paint's gradient, primary), --scratch-canvas (the canvas under it, muted), --scratch-sketch (the pencil marks, muted foreground; -line, -arc and -text tune each mark), --scratch-label (the label on the paint) and --scratch-ink (the label once revealed). The label takes the page font.
Decoration, not a control: there is no focus state, and reduced motion swaps without the fade. The label renders twice, once hidden from assistive tech, so keep it to plain text.
It accepts the HTML attributes of the element it renders.
Dependencies
npm: cn. The CLI installs it for you.
Used in blocks
One block is built with Scratch Reveal.
Last updated on