Skip to main content
Clever Ops

Refraction Pane

A floating glass pane (ogl) that refracts a token-inked drafting plate: lens distortion, chromatic split and a primary fresnel rim. Ambient drift, spring drag-return, keyboard operable.

Preview & code

Loading Refraction Pane preview

Installation

pnpm dlx shadcn@latest add @cleverui/refraction-pane

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

Usage

tsx
import { RefractionPane } from '@/components/ui/refraction-pane'
Exampletsx
import { RefractionPane } from '@/components/ui/refraction-pane'

const specs = [
  { k: 'lens', v: 'barrel magnify, chromatic split' },
  { k: 'spring', v: 'stiffness 400, damping 26' },
  { k: 'keys', v: 'arrows nudge, esc resets' },
] as const

export default function RefractionPaneDemo() {
  return (
    <section className="bg-background py-16 sm:py-24">
      <div className="mx-auto max-w-6xl px-4 sm:px-6">
        <div className="grid items-center gap-10 lg:grid-cols-[1fr_1.15fr]">
          <div>
            <p className="font-mono text-[11px] uppercase tracking-[0.2em] text-muted-foreground sm:text-xs">
              Lab · WebGL optics
            </p>
            <h2 className="mt-4 max-w-xl text-3xl font-semibold tracking-tight text-balance text-foreground sm:text-4xl">
              Precision optics on a drafting table.
            </h2>
            <p className="mt-4 max-w-md text-sm leading-relaxed text-muted-foreground sm:text-base">
              A floating glass pane refracts the plotted field behind it: lens
              magnification, a chromatic split and a primary fresnel rim, all
              sampled live from a token-inked plate. Drag the pane, nudge it
              with the arrow keys, or leave it to its slow survey.
            </p>
            <dl className="mt-8 space-y-3">
              {specs.map((s) => (
                <div key={s.k} className="flex items-baseline gap-4">
                  <dt className="w-16 shrink-0 font-mono text-[11px] uppercase tracking-[0.2em] text-foreground">
                    {s.k}
                  </dt>
                  <dd className="text-xs text-muted-foreground sm:text-sm">{s.v}</dd>
                </div>
              ))}
            </dl>
          </div>
          <RefractionPane className="h-[380px] w-full rounded-2xl border border-border/60 sm:h-[440px]" />
        </div>
      </div>
    </section>
  )
}

API reference

RefractionPane accepts the following props.

PropTypeDefaultDescription
wordstring'Refraction'ghost display word tiled through the drafting plate (default 'Refraction')
intensitynumber0.65refraction strength 0–1: lens magnification, barrel, chromatic split (default 0.65)

…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 Refraction Pane component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/refraction-pane`. 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 Refraction Pane require?

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

Can I theme Refraction Pane 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