Library navigation

Dithered Logo

A configurable logo silhouette filled with the animated ordered-dither shader.

A logo silhouette filled with flowing, two-color ordered dithering. Uses the existing Dither Background shader and a CSS image mask.

Installation

text
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

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

Props

PropTypeDefaultDescription
srcstring/logo.svgSVG or transparent image used as the 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][0.02, 0.86, 0.5]Foreground RGB channels from 0 to 1.
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