Skip to main content
Clever Ops

Depth Fade

A long-form wrapper where blocks you have read past gently recede in opacity and scale, keeping the active block crisp, reading focus as depth, clamped so text never goes illegible.

Preview & code

Loading Depth Fade preview

Installation

pnpm dlx shadcn@latest add @cleverui/scroll-depth-fade

Requires the @cleverui registry in your components.json, a one-off, two-line setup.

Usage

tsx
import { ScrollDepthFade } from '@/components/ui/scroll-depth-fade'
Exampletsx
import { ScrollDepthFade } from '@/components/ui/scroll-depth-fade'

export default function ScrollDepthFadeDemo() {
  return (
    <div className="py-16 sm:py-24">
      <ScrollDepthFade>
        <header className="space-y-4">
          <p className="font-mono text-[11px] uppercase tracking-[0.2em] text-muted-foreground sm:text-xs">
            Field notes · issue 14
          </p>
          <h2 className="text-3xl font-semibold tracking-tight text-balance text-foreground sm:text-4xl">
            Why Meridian stopped rewarding the loudest exception
          </h2>
          <p className="max-w-prose text-base leading-relaxed text-muted-foreground sm:text-lg">
            A reading instrument for controllers: the block you are in stays
            crisp; everything already decided steps one notch back, never
            blur, never ghosted.
          </p>
        </header>

        <section className="max-w-prose space-y-4 border-t border-border/60 pt-10 sm:pt-14">
          <h3 className="text-xl font-semibold tracking-tight text-foreground sm:text-2xl">
            Stand-ups were status theater
          </h3>
          <p className="text-sm leading-relaxed text-muted-foreground sm:text-base">
            Every morning, twelve people recited open lines from personal
            spreadsheets. The loudest gap won airtime. Quiet mismatches,
            wrong cost center, missing receipt, dual-approval stall, sat
            until Friday. Close age told the real story: 41 hours median
            before anyone owned the line.
          </p>
          <p className="text-sm leading-relaxed text-muted-foreground sm:text-base">
            We stopped asking “what are you working on?” and started asking
            “which exception is oldest on the board?” The board became the
            agenda. Personal slides disappeared.
          </p>
        </section>

        <section className="max-w-prose space-y-4 border-t border-border/60 pt-10 sm:pt-14">
          <h3 className="text-xl font-semibold tracking-tight text-foreground sm:text-2xl">
            Depth, not drama
          </h3>
          <p className="text-sm leading-relaxed text-muted-foreground sm:text-base">
            Readers do not need entrance choreography. They need the
            paragraph under their eyes to hold contrast while yesterday’s
            argument softens just enough to mark progress. That is the
            whole instrument: opacity floor at 0.6, scale at 0.98, reversible
            in both directions.
          </p>
          <p className="text-sm leading-relaxed text-muted-foreground sm:text-base">
            Scroll back up. The section you re-enter snaps crisp again.
            Nothing is once-only. Nothing leaves the accessibility tree.
          </p>
        </section>

        <section className="max-w-prose space-y-4 border-t border-border/60 pt-10 sm:pt-14">
          <h3 className="text-xl font-semibold tracking-tight text-foreground sm:text-2xl">
            What the board measures now
          </h3>
          <p className="text-sm leading-relaxed text-muted-foreground sm:text-base">
            Owner, age, policy reference, and source hash. No “almost
            done.” No screenshot audits. When an external auditor asks how
            a line closed, the pack already answers, decisions, overrides,
            and the rule that allowed them.
          </p>
          <p className="text-sm leading-relaxed text-muted-foreground sm:text-base">
            Close fell from nine calendar days to three. The controller’s
            only remaining complaint: the board is almost too quiet.
          </p>
        </section>

        <section className="max-w-prose space-y-4 border-t border-border/60 pt-10 sm:pt-14">
          <h3 className="text-xl font-semibold tracking-tight text-foreground sm:text-2xl">
            Keep the active page sharp
          </h3>
          <p className="text-sm leading-relaxed text-muted-foreground sm:text-base">
            Treat focus as a depth cue, not a spotlight stunt. Clamp the
            recede so body copy never dips below readable contrast. Let
            upcoming sections wait at full opacity, punishing reading
            ahead is how long-form tools lose trust.
          </p>
        </section>
      </ScrollDepthFade>
    </div>
  )
}

API reference

ScrollDepthFade accepts the following props.

PropTypeDefaultDescription
children*ReactNodelong-form content; each direct child block becomes a depth-tracked section
minOpacitynumber0.6opacity floor for passed blocks; clamped to 0.85 or above so text stays AA-legible
recedeScalenumber0.98scale applied to passed blocks; clamped to 0.96 or above
markActivebooleantruerender a 2px primary keyline beside the active block on lg

…plus everything from React.HTMLAttributes<HTMLDivElement>: className, event handlers, aria attributes and the rest pass straight through.

Frequently asked questions

How do I install the Depth Fade component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/scroll-depth-fade`. The shadcn CLI copies the source into your project, you own the code from that point. You can also copy the source directly from this page.

What dependencies does Depth Fade require?

Depth Fade uses motion on top of React and Tailwind CSS. You don't need to install it manually, the shadcn CLI resolves and installs npm dependencies automatically when you add the component.

Can I theme Depth Fade to match my brand?

Yes. The component is styled entirely with Tailwind utilities over standard design tokens (primary, background, muted, border), so it inherits your existing shadcn/ui theme automatically. Change your CSS variables and the component follows, no source edits needed for palette, radius, or fonts.

Want this built for you?

CleverUI is built by the Clever Ops web team. If you'd rather ship a hand-coded, fast, custom website than assemble one, we build them for Australian businesses every week.

Explore web development services