Dither Trail
Put it round an empty state or a landing section and the pointer writes on it in dithered ink: the stroke is wide when the hand moves slowly and thin when it's quick, as a pen's is; a click throws a splat of droplets; and the ink dries away dot by dot, the stipple thinning until the page is clean again. Several inks take turns stroke by stroke. It sits behind the content and reads the pointer from the window, so whatever's inside keeps its own clicks. Off with reduced motion.
Needs: None. Canvas 2D.
Customize
inks
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | – | What the trail sits behind. |
| tone | string | string[] | – | The ink, or several to take turns stroke by stroke. The text colour by default. |
| size | number | 26 | The pen's width in px when it moves slowly. |
| fade | number | 1.4 | Seconds the ink takes to dry to a tenth. |
| splat | boolean | true | A click throws a splat of ink. |
| over | boolean | false | Draw over the content instead of behind it. |
| cell | number | 3 | Size of one dither cell in px. |
| className | string | – | Class on the area: give it its size. |
| style | CSSProperties | – | Style on the area. |