A logo with flowing ordered dithering that preserves the source image’s colors. Uses the existing Dither Background shader, image compositing, and a CSS image mask.

Installation

Add the dithered-logo component from Hangry UI to this project.
Use the project's package manager to run:
shadcn@latest add https://ui.razeev.com/r/dithered-logo.json
Integrate the component with the existing layout and styling.
Keep its interactions and reduced-motion support intact.

How to use

import { DitheredLogo } from "@/components/hangry-ui/components/dithered-logo";
<DitheredLogo
src="/your-logo.svg"
alt="Your brand"
ratio={2}
pixelSize={3}
speed={0.4}
className="max-w-md"
/>;

Props

PropTypeDefaultDescription
srcstring/logo.svgSVG or transparent image providing the logo colors and alpha mask.
altstringHangry UIAccessible logo label. Set to an empty string for a decorative logo.
rationumber2Positive width-to-height ratio of the logo container.
color[number, number, number]Source imageOptional foreground RGB override, with channels from 0 to 1. Omit to preserve the source logo colors.
backgroundColor[number, number, number][0.02, 0.04, 0.035]Background RGB channels from 0 to 1.
pixelSizenumber3Dither cell size in CSS pixels; minimum 1.
speednumber0.4Wave speed; set to 0 for a still frame.
Native div propsComponentProps—

Classes, style, IDs, and native attributes. Children are not supported and color is reserved for the shader.

Dependencies

  • Motion
  • vgpu