# Halftone

> A screen of lit dots: swirling ribbons of light drawn by the size and brightness of each dot.

## Spec sheet

| | |
| --- | --- |
| Access | Free: no account, free for commercial use |
| Shelf | Backgrounds › Backgrounds |
| Live preview | https://uibrik.com/components/halftone |
| Writes | 1 files into `components/uibrik/halftone/`, plus `components/uibrik/_shader-background/ShaderSurface.tsx` |
| Packages | none beyond React |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 9, 2026 |

## Add it

```bash
npx shadcn@latest add https://uibrik.com/r/halftone.json
```

With the `@uibrik` namespace in `components.json` ([setup](https://uibrik.com/docs/installation.md)): `npx shadcn@latest add @uibrik/halftone`.

Can't run commands? https://uibrik.com/components/halftone/prompt-full.txt has every file verbatim, with the setup steps, ready for an assistant to write.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { Halftone } from "@/components/uibrik/halftone/halftone";

<Halftone
  colors={["#1b2533", "#5c7a9a", "#c9d6e0", "#f6ecdc"]}
  background="#050608"
  spacing={7}
  dotSize={0.95}
  minDot={0.3}
  angle={0}
  frequency={1.3}
  flow={1.2}
  bandWidth={1}
  contrast={1.1}
  glow={0.5}
  softness={0}
  fade={0}
  fadeFrom="edges"
  speed={1}
  seed={0}
  animate
  interactive
  radius={70}
  trailStrength={0.85}
  trailLength={0.9}
  follow={0.55}
>
  …
</Halftone>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/halftone.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `colors` | `string[]` | `["#1b2533","#5c7a9a","#c9d6e0","#f6ecdc"]` | Dot colours from dim to bright, blended in OKLCH; 2 to 6. |
| `background` | `string` | `"#050608"` | Colour behind the dots. |
| `spacing` | `number` | `7` | Distance between dots. |
| `dotSize` | `number` | `0.95` | Largest dot, as a share of the spacing; 1 lets the brightest dots touch. |
| `minDot` | `number` | `0.3` | Smallest dot (in the dark), as a share of the largest; 0 lets dark dots vanish. |
| `angle` | `number` | `0` | Grid angle. |
| `frequency` | `number` | `1.3` | Size of the ribbons of light; higher is busier. |
| `flow` | `number` | `1.2` | How much the ribbons curl. |
| `bandWidth` | `number` | `1` | Thickness of the ribbons. |
| `contrast` | `number` | `1.1` | Higher gives darker darks and fuller lights. |
| `glow` | `number` | `0.5` | Light spilling around the brightest dots. |
| `softness` | `number` | `0` | Blur on each dot's edge. |
| `fade` | `number` | `0` | How much the dots fade out toward the chosen side. |
| `fadeFrom` | `"edges" \| "top" \| "bottom" \| "left" \| "right"` | `"edges"` | Where the dots fade out. |
| `speed` | `number` | `1` | Animation speed; 1 is the designed pace. |
| `seed` | `number` | `0` | Shifts the composition, so two backgrounds with the same settings still differ. |
| `animate` | `boolean` | `true` | Move on its own. Off draws one still frame. |
| `interactive` | `boolean` | `true` | React to the pointer. |
| `radius` | `number` | `70` | Width of the pointer trail. |
| `trailStrength` | `number` | `0.85` | How strongly the trail lights the dots. |
| `trailLength` | `number` | `0.9` | Seconds the trail takes to fade. |
| `follow` | `number` | `0.55` | How lazily the trail follows the pointer, 0 (locked) to 1 (drifts after it). |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `children` | `ReactNode` |  | Content shown on top of the background. |
| `className` | `string` |  | Classes for the box; it fills whatever size you give it. |

## Where it fits

- **Print-inspired backgrounds**: Swirling ribbons drawn by dot size give a page a newspaper or poster feel. Pairs with [Dither Gradient](https://uibrik.com/components/dither-gradient.md).
- **Music and event pages**: Lit dots in motion suit gig posters, festivals and album sites.
- **Agency heroes**: A graphic, high-contrast pattern fits studios with a bold visual identity.

## Same shelf: Backgrounds

- [Halftone Horizon](https://uibrik.com/components/halftone-horizon.md) (Pro): An arched horizon printed in halftone in the dark, where the dots grow with the light until they fuse into a smooth glow.
- [Horizon Gradient](https://uibrik.com/components/horizon-gradient.md): Black fading through deep blue to white in bands that arch like a horizon, breathing slowly.
- [Ice Tiles](https://uibrik.com/components/ice-tiles.md) (Pro): Soft blobs of colour seen through a wall of frosted ice cubes, stepping from cube to cube.
- [Ink Plume](https://uibrik.com/components/ink-plume.md) (Pro): A soft plume of black ink rising through white, split at its edges into ultramarine and vermilion, spreading to a haze as it climbs.
- [LED Field](https://uibrik.com/components/led-field.md) (Pro): A dark panel of tiny lights where clusters of glowing pixels drift and blink slowly, and the pointer leaves a trail of lit cells that blink back off.
- [LED Spire](https://uibrik.com/components/led-spire.md) (Pro): A flaring spire of light strips that fills from the bottom up, then sends waves of colour up the strips, from the centre out to both edges.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/halftone/` so the import paths keep resolving.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
