Skip to Content
Puzzle

Background

Theme-aware decorative background patterns.

Import

import { Background } from "@puzzle-ui/ui";

Patterns

Use backgrounds behind real content rather than as the only way to communicate meaning.

390 × 500

API

PropTypeDefaultDescription
asElementType"div"Semantic root element.
pattern"grid" | "dots" | "checkerboard" | "stripes" | "crosshatch" | "glow" | "blueprint" | "topographic" | "mesh""grid"Decorative pattern.
sizenumber | string24Pattern cell size; numbers are pixels.
majorSizenumber | string-Major grid spacing.
lineWidth, dotSizenumber | string1, 2Pattern line/dot dimensions.
anglenumber | string45Stripe angle; numbers are degrees.
patternColor, backgroundColorstringTheme-derivedCSS colors; prefer theme variables.
patternOpacitynumber-Pattern opacity, clamped to 0-1.
meshColorsreadonly [string, string, string, string]Theme-derivedFour mesh colors.
fade"top" | "right" | "bottom" | "left"-Fade pattern toward an edge.
childrenReactNode-Foreground content.

Native props for the selected element, including className and style, are forwarded. Check foreground contrast when customizing colors.

On this page

;