Dither Banner
Without a photo it prints a slow-flowing field, the inks blending through blue noise where they meet and drifting so gently you notice only on looking back; with one, it prints the photo in those inks. Either way the middle stays calm, the ink thinning toward the page where the headline sits, and the print develops in when it first comes into view. Everything you put inside it stays real, readable page content.
Needs: None. Canvas 2D. Photos must be same-origin or CORS-enabled.
Customize
inks
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | – | The headline, the call to action: whatever sits on the banner. |
| src | string | – | A photo to print. Without one, a slow-flowing field of the inks. |
| colours | string[] | "[\"#3255a4\", \"#c4365f\", \"#e0703a\"]" | Two to four inks, darkest tones' first. |
| quiet | number | 0.85 | How calm the middle is kept, 0 to 1. |
| drift | boolean | true | The field drifts slowly. |
| cell | number | 3 | Size of one dither cell in px. |
| alt | string | – | For screen readers, when the picture matters. Left out, it's decoration. |
| className | string | – | Class on the banner: give it its padding and height. |
| style | CSSProperties | – | Style on the banner. |