Signature / Molecule
Dot Pattern
Static SVG dot grid background with configurable size, gap, and theme colors.
pnpm dlx @glinui/cli@latest add dot-patternDocs, reimagined
Documentation your team keeps current
Write in Markdown, review in pull requests and publish to a fast static site with search and versioning built in.
Works with
- Vercel
- GitHub
- Cloudflare
- Astro
Installation$
Install from
pnpm dlx @glinui/cli@latest add dot-patternPrefer the package?
Usage$
Place inside a relative container for a subtle dot grid background. Fully themeable via props.
Examples$
Variants$
Default
Large dots
Tight
import { DotPattern } from "@glinui/ui"
export function Variants() { return ( <div data-glin-theme="dark" className="grid w-full gap-3 sm:grid-cols-3"> <div className="relative isolate flex h-44 items-end overflow-hidden rounded-xl bg-[var(--surface-0)] p-3"> <DotPattern className="[mask-image:radial-gradient(240px_circle_at_center,white,transparent)]" /> <span className="relative z-10 rounded-full bg-black/70 px-2.5 py-1 text-xs font-medium text-white">Default</span> </div> <div className="relative isolate flex h-44 items-end overflow-hidden rounded-xl bg-[var(--surface-0)] p-3"> <DotPattern dotSize={2.5} gap={30} dotOpacity={0.35} className="[mask-image:radial-gradient(240px_circle_at_center,white,transparent)]" /> <span className="relative z-10 rounded-full bg-black/70 px-2.5 py-1 text-xs font-medium text-white">Large dots</span> </div> <div className="relative isolate flex h-44 items-end overflow-hidden rounded-xl bg-[var(--surface-0)] p-3"> <DotPattern dotSize={1} gap={12} dotOpacity={0.3} className="[mask-image:radial-gradient(240px_circle_at_center,white,transparent)]" /> <span className="relative z-10 rounded-full bg-black/70 px-2.5 py-1 text-xs font-medium text-white">Tight</span> </div> </div> )}Behind a sign in card$
import { DotPattern, Button, Heading, Input, Label, Text } from "@glinui/ui"
export function SignIn() { return ( <section data-glin-theme="dark" className="relative isolate flex min-h-[26rem] w-full items-center justify-center overflow-hidden rounded-xl bg-[var(--surface-0)] px-4 py-10"> <DotPattern className="[mask-image:radial-gradient(520px_circle_at_center,white,transparent)]" /> <form className="relative z-10 flex w-full max-w-sm flex-col gap-4 rounded-2xl border border-[var(--line-soft)] bg-[var(--surface-1)] p-6 text-left [box-shadow:var(--shadow-lg)]"> <div className="flex flex-col gap-1"> <Heading level={2} size="sm">Sign in to Northwind</Heading> <Text size="sm" variant="muted">Use your work email to continue.</Text> </div> <div className="flex flex-col gap-1.5"> <Label htmlFor="email">Work email</Label> <Input id="email" type="email" autoComplete="email" placeholder="you@company.com" /> </div> <div className="flex flex-col gap-1.5"> <Label htmlFor="password">Password</Label> <Input id="password" type="password" autoComplete="current-password" placeholder="At least 12 characters" /> </div> <Button type="submit" className="w-full">Continue</Button> </form> </section> )}Accessibility$
- SVG is marked
aria-hidden, invisible to screen readers. - Purely decorative background pattern.
Reduced Motion$
No animation, static SVG pattern. No reduced motion handling needed.
API Reference$
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
cr | number | No | - | Auto-generated from TypeScript source. |
dotColor | string | No | "currentColor" | Auto-generated from TypeScript source. |
dotOpacity | number | No | 0.2 | Auto-generated from TypeScript source. |
dotSize | number | No | 1.5 | Auto-generated from TypeScript source. |
gap | number | No | 20 | Auto-generated from TypeScript source. |
Source$
import { DotPattern } from "@glinui/ui"packages/ui/src/components/dot-pattern.tsx
Generated API Snapshot
Beta
Generated API Snapshot
BetaAuto-extracted from TypeScript source in packages/ui/src/components/dot-pattern.tsx. This section is in beta and may lag behind hand-curated docs. Regenerate with pnpm --filter @glinui/docs api:generate.
Generated: 2026-10-08T01:41:21.546Z · Full index: /docs/api-metadata
Primary Props Type
DotPatternProps
DotPatternProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
cr | number | No | - | - |
dotColor | string | No | "currentColor" | - |
dotOpacity | number | No | 0.2 | - |
dotSize | number | No | 1.5 | - |
gap | number | No | 20 | - |