Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Halftone Pattern

ProNew

A repeating screen of four dot sizes, inspired by printed halftones.

Installation

pnpm dlx shadcn@latest add @viewport/halftone-pattern

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
sizenumber

Width and height of the repeating four-dot tile in CSS pixels.

24
classNamestring

Use text color utilities to tint the dots.

—
styleCSSProperties—

Accessibility

  • Decorative and hidden from assistive technology.
  • Ignores pointer events and is hidden in forced-colors mode.
  • Static and requires no browser JavaScript to paint.