Interfacestable
Dither
Pixel hover highlight
A pixel hover layer for any card, link or button: blocks sweep in from the pointer, or a quick block frame lights the edge.
The cards are a radio choice and never navigate. Pass as={Link} when a card should.
Customize
Pixelshover style, block size, glow and colour
variant8 px
cell0.50
glowcolorSweepfill, resting texture and timing; sweep variant only
0.300
density420 ms
durationoriginStatestacking and a held-on state
layeractiveUsage
import { Dither } from "zerogravity/dither"
<Dither>
<YourCard />
</Dither>Generated from the controls above. Only props that differ from their defaults are shown.
Props
| Property | Type | Default | Description |
|---|---|---|---|
variant | "sweep" | "edge" | "sweep" | Variant. |
cell | number | 8 | Cell. Range 4 to 24 px. |
glow | number | 0.5 | Glow. Range 0 to 1.5. |
color | string | "#4ee1f2" | Colour. |
density | number | 0.3 | Rest density. Range 0 to 1. |
duration | number | 420 | Duration. Range 120 to 1400 ms. |
origin | "pointer" | "center" | "left" | "right" | "top" | "bottom" | "pointer" | Origin. |
layer | "under" | "over" | "under" | Layer. |
active | boolean | false | Force active. |
as | ElementType | "div" | Element or component to render, such as "a", "button" or a router Link. |
children | ReactNode | — | Content drawn above the pixel layer and left fully interactive. |
colors | string[] | — | Several block colours, assigned per cell. Overrides color. |
disabled | boolean | false | Render the element without the pixel layer. |
respectReducedMotion | boolean | true | Show the settled state instantly instead of sweeping or stepping in. |
Dependencies
0 external runtime dependencies
Ships with nothing but React.