Jack UI logoJackUI
ComponentsButtons

Dither Effect Button

A clean, minimal interaction button with ordered Bayer matrix and halftone dot dithering patterns that emerge on hover.


Component Overview

The DitherEffect button is a premium interaction component featuring mathematical pixel dithering surfaces.

Each configuration provides a distinctly different visual personality:

  1. Get Started: Linear Ordered Bayer matrix that sweeps cleanly from left-to-right across the surface as the cursor enters.
  2. Continue: True Radial pixel ripple that blossoms outwards in circular waves directly centered on the cursor's entrance point.
  3. Explore: Offset Halftone circular dot matrix with an isometric diagonal sweep and an inline interactive chevron.

Key Highlights:

  • Three Distinct Dither Physics:
    • pattern="ordered": Crisp 4×4 Bayer matrix blocks.
    • pattern="noise": Fine-grain blue-noise stochastic pixels.
    • pattern="halftone": Organic circular dot screen lithography.
  • Three Distinct Reveal Geometries:
    • direction="left-to-right": Progressive horizontal sweep.
    • direction="radial": Expands circular dither ripples directly from the pointer.
    • direction="diagonal": 45° dynamic corner-to-corner wash.
  • Maximum Text Legibility: The dither matrix lives behind the text with calibrated contrast and micro-shadows, ensuring text stays razor-sharp and effortlessly readable in every state.
  • Zero-Latency Click Response: Instant micro-pulse feedback on click without delaying the native button handler.
  • Full Accessibility Support: Native <button> semantics, keyboard navigation (Tab, Enter, Space), standard focus rings, and reduced motion detection.

Installation

bunx shadcn@latest add https://jackui.com/r/dither-effect.json
npx shadcn@latest add https://jackui.com/r/dither-effect.json
pnpm dlx shadcn@latest add https://jackui.com/r/dither-effect.json

The component will be placed in your project at:

components/jackui/buttons/dither-effect.tsx

Usage

"use client";

import React from "react";
import DitherEffect from "@/components/jackui/buttons/dither-effect";

export function DitherEffectDemo() {
  return (
    <div className="flex min-h-[14rem] w-full flex-wrap items-center justify-center gap-4 p-8 bg-zinc-950">
      {/* 1. Linear Bayer Matrix */}
      <DitherEffect variant="default" pattern="ordered" direction="left-to-right">
        Get Started
      </DitherEffect>

      {/* 2. Pointer-Anchored Radial Ripple */}
      <DitherEffect variant="dark" pattern="noise" direction="radial">
        Continue
      </DitherEffect>

      {/* 3. Halftone Dots with Arrow */}
      <DitherEffect variant="outline" pattern="halftone" direction="diagonal" showArrow>
        Explore
      </DitherEffect>
    </div>
  );
}

Component Props

PropTypeDefaultDescription
variant"default" | "dark" | "outline""default"Button surface and border styling.
pattern"ordered" | "halftone" | "noise""ordered"Dither matrix geometry (ordered pixels, halftone dots, or noise).
direction"left-to-right" | "radial" | "diagonal""left-to-right"Pattern sweep geometry across the button.
intensity"subtle" | "medium" | "strong""medium"Dither matrix contrast level.
durationnumber280Reveal duration in milliseconds.
showArrowbooleanfalseShows an inline interactive action chevron.
disabledbooleanfalseDisables interaction and hover effects.
classNamestringundefinedCustom CSS classes.
onClick(e: MouseEvent) => voidundefinedStandard button click handler.

Accessibility & Performance

  • Reduced Motion: Automatically detects prefers-reduced-motion and avoids animated sweeps.
  • Low-Overhead Canvas: When the button is not being hovered or clicked, the canvas loop completely shuts down, drawing zero frames and consuming zero idle CPU/GPU resources.
  • Accessible Text: Built to WCAG standards with high-contrast text layering that maintains clarity across all hover states.