DitherButton

Get this button for GPUI

A button with an animated 4x4 ordered-dither wave background and a knockout label.

Preview

Props

Variants

Rounded pill

Hot pink

Tiny chip

Chunky dither

Fine dither

Install

npx shadcn@latest add @evilbuttons/dither-button

Usage

import DitherButton from "@/components/evil-buttons/dither-button";

export function ButtonDemo() {
  return <DitherButton>Launch</DitherButton>;
}

Props

The component spreads any <button> HTML attributes.

PropTypeDefaultDescription
childrenReact.ReactNode-The visible button label or content.
classNamestring-Extra classes passed to the button.
ditherColorstring (hex)-Override the dither "on" pixel color (e.g. #ff0066). Falls back to the resolved color.
ditherOpacitynumber (0–1)1CSS opacity applied to the dither canvas.
ditherSizenumber (1–32)4Pixel scale of the dither particles. Higher = chunkier blocks.

Good to know

  • Dither colors follow the canvas's CSS color and background-color, so it themes itself.
  • Draws one still frame under prefers-reduced-motion.

Search docs

Jump to a button documentation page