Design tweak preview

Design tweak

A before/after compare card with a slider or toggle, plus a short list of what was removed — for the "remove first" design pass.

  • Group
    Compare
  • Origin
    Inspired · Original (this library)
  • License
    MIT
  • Added
    Oct 27
npx shadcn@latest add @deank/design-tweak

The registry stays private. Install from the repo with a GitHub token — see the README.

Usage

import { DesignTweak } from "@/registry/components/design-tweak/design-tweak";

<DesignTweak before={<span>…</span>} after={<span>…</span>} />

Props

PropTypeDefaultDescription
beforeReactNode | { src: string; alt?: string }Left / "before" side: image URL or a React node
afterReactNode | { src: string; alt?: string }Right / "after" side
title?string"Remove first"Caption above the compare
subtitle?stringSmall text under the title
beforeLabel?string"Before"Labels on the before / after corners
afterLabel?string"After"
removed?DesignTweakChange[][]What was removed in this pass
removedTitle?string"What I removed"Heading over the removed list
mode?"slider" | "toggle""slider"Compare interaction: drag a divider, or a toggle that swaps sides
defaultPosition?number52Initial slider position 0–100 (slider mode)
defaultShowAfter?booleanfalseStart showing the after side (toggle mode)
className?string

When to use

Showing a design cleanup or "remove first" pass: a before/after of the same screen, with a short list of what you cut.

When not to use

General image comparison without a change list (build a plain slider); metric diffs over time (use change-summary); a full multi-state QA gallery (use state-catalog).

Related

Change summary · State catalog · Artifact preview