Skip to content
Components / Brand

Dither canvas

The engine under the brand pieces: any brightness field, dithered onto a colour ramp.

@fabrials/ui
Loading state

Installation

  1. Import the control from @fabrials/ui, after setting the app up.

    TypeScript
    import { DitherCanvas } from "@fabrials/ui";

API reference

Prop / exportTypeDescription
field(theme, size, progress) => (u, v) => 0…1Brightness at each point; built again on resize and theme change.
rampstring[] | { light, dark }Colours. "background" as the first stop is the surface behind the canvas.
orderbrightness | rampramp keeps the order: 0 is the first colour, 1 the last.
reveal / stars / paintKeynumber / DitherStars / keyOne-time reveal, crisp stars in dark mode, repaint on new data.

Behavior

A backdrop: it fills its positioned parent and sits behind the content, so the parent needs position: relative and isolation: isolate (Tailwind relative isolate). Pure helpers live in @fabrials/ui/dither (paintRampField, STORM_RAMP, gemRamp, stormField, gemField). Products may add their own fields on the same engine.

Accessibility

Keyboard and contrast
Keep visible labels, keyboard focus and status announcements when customizing. These components inherit your theme; maintain sufficient contrast in both color modes. The preview is keyboard operable.