Layout
pattern
A quiet background of dots, a grid or diagonal lines drawn in the theme's hairline colour, filling the box it sits in, behind the content and hidden from screen readers.
When to use it
A section or a card that needs a texture to set it apart without a colour or a gradient: a hero, an empty state, a canvas. Keep it faint; for a photograph or an illustration use an image.
See it working
The demonstration the browser checks drive, with the keyboard as well as the pointer. More of it is on the Effects and 3D data page.
Word rotate and pattern
Maps for teams, schools, or newsrooms
Animated beam
A map becomes a film.
Orbit
- Maps
- Charts
- Films
- Motion
Confetti
Not yet published.
Point cloud
- Clay
- Stone
- Glass
| # | width | height | kind |
|---|---|---|---|
| 1 | 0.2 | 1.2 | Clay |
| 2 | 0.2 | 2.1 | Clay |
| 3 | 0.2 | 2.5 | Clay |
| 4 | 0.3 | 0.6 | Clay |
| 5 | 0.3 | 2.2 | Clay |
| 6 | 0.3 | 2.5 | Clay |
| 7 | 0.4 | 0.5 | Clay |
| 8 | 0.5 | 0.6 | Clay |
| 9 | 0.5 | 2.1 | Clay |
| 10 | 0.6 | 1.4 | Clay |
| 11 | 0.7 | 0.7 | Clay |
| 12 | 0.8 | 1.4 | Clay |
| 13 | 0.9 | 0.6 | Clay |
| 14 | 1 | 0.5 | Clay |
| 15 | 1.1 | 2.2 | Clay |
| 16 | 1.2 | 0.6 | Clay |
| 17 | 1.2 | 1.1 | Stone |
| 18 | 1.2 | 1.2 | Stone |
| 19 | 1.2 | 1.2 | Stone |
| 20 | 1.2 | 2.5 | Clay |
| 21 | 1.3 | 1.1 | Clay |
| 22 | 1.3 | 1.3 | Stone |
| 23 | 1.3 | 1.7 | Stone |
| 24 | 1.3 | 2 | Stone |
| 25 | 1.5 | 2.5 | Clay |
| 26 | 1.5 | 2.6 | Stone |
| 27 | 1.5 | 2.8 | Stone |
| 28 | 1.6 | 1.3 | Clay |
| 29 | 1.6 | 2.1 | Clay |
| 30 | 1.6 | 3.1 | Stone |
| 31 | 1.7 | 2 | Clay |
| 32 | 1.7 | 3.1 | Stone |
| 33 | 1.8 | 2 | Clay |
| 34 | 1.8 | 2.9 | Stone |
| 35 | 1.8 | 3.1 | Stone |
| 36 | 1.9 | 1.2 | Clay |
| 37 | 1.9 | 2.7 | Stone |
| 38 | 2 | 2.5 | Clay |
| 39 | 2.1 | 0.6 | Clay |
| 40 | 2.1 | 2.2 | Clay |
| 41 | 2.1 | 2.7 | Stone |
| 42 | 2.2 | 0.7 | Clay |
| 43 | 2.2 | 1.3 | Clay |
| 44 | 2.2 | 1.5 | Clay |
| 45 | 2.2 | 2 | Stone |
| 46 | 2.2 | 2.6 | Glass |
| 47 | 2.2 | 2.6 | Stone |
| 48 | 2.2 | 3.4 | Glass |
| 49 | 2.2 | 3.7 | Glass |
| 50 | 2.3 | 1.8 | Stone |
| 51 | 2.3 | 3.7 | Glass |
| 52 | 2.4 | 1.7 | Glass |
| 53 | 2.4 | 1.8 | Glass |
| 54 | 2.4 | 3.3 | Glass |
| 55 | 2.5 | 1.3 | Stone |
| 56 | 2.6 | 1.2 | Stone |
| 57 | 2.6 | 1.8 | Glass |
| 58 | 2.6 | 2.4 | Glass |
| 59 | 2.7 | 1.2 | Stone |
| 60 | 2.7 | 2.3 | Glass |
| 61 | 2.8 | 1.2 | Stone |
| 62 | 2.9 | 1.3 | Stone |
| 63 | 2.9 | 1.7 | Stone |
| 64 | 2.9 | 2.5 | Glass |
| 65 | 3 | 1.7 | Glass |
| 66 | 3 | 1.9 | Stone |
| 67 | 3 | 3.2 | Glass |
| 68 | 3.1 | 1.8 | Glass |
| 69 | 3.1 | 1.8 | Stone |
| 70 | 3.1 | 2.1 | Stone |
| 71 | 3.1 | 2.6 | Stone |
| 72 | 3.1 | 2.8 | Stone |
| 73 | 3.2 | 2.7 | Stone |
| 74 | 3.2 | 3.1 | Stone |
| 75 | 3.3 | 1.9 | Glass |
| 76 | 3.4 | 2.5 | Glass |
| 77 | 3.4 | 3.7 | Glass |
| 78 | 3.5 | 3.5 | Glass |
| 79 | 3.7 | 2.7 | Glass |
| 80 | 3.7 | 3.4 | Glass |
| 81 | 3.8 | 2.6 | Glass |
| 82 | 3.8 | 3.4 | Glass |
| 83 | 4 | 1.9 | Glass |
| 84 | 4 | 2.5 | Glass |
| 85 | 4 | 3.7 | Glass |
| 86 | 4.1 | 3.3 | Glass |
| 87 | 4.2 | 1.8 | Glass |
| 88 | 4.2 | 2.3 | Glass |
| 89 | 4.2 | 2.4 | Glass |
| 90 | 4.2 | 3.2 | Glass |
| # | width | height | depth | kind |
|---|---|---|---|---|
| 1 | 1.2 | 2.5 | 2.5 | Clay |
| 2 | 3.2 | 2.7 | 3.2 | Stone |
| 3 | 2.9 | 2.5 | 3.8 | Glass |
| 4 | 0.3 | 0.6 | 4.3 | Clay |
| 5 | 2.7 | 1.2 | 4.5 | Stone |
| 6 | 4 | 2.5 | 4.4 | Glass |
| 7 | 0.5 | 2.1 | 4.1 | Clay |
| 8 | 1.6 | 3.1 | 3.5 | Stone |
| 9 | 4.1 | 3.3 | 2.9 | Glass |
| 10 | 1.6 | 1.3 | 2.1 | Clay |
| 11 | 1.2 | 1.2 | 1.4 | Stone |
| 12 | 3.1 | 1.8 | 0.9 | Glass |
| 13 | 2.2 | 1.3 | 0.6 | Clay |
| 14 | 2.1 | 2.7 | 0.5 | Stone |
| 15 | 2.2 | 3.7 | 0.7 | Glass |
| 16 | 1.6 | 2.1 | 1.2 | Clay |
| 17 | 3.1 | 1.8 | 1.8 | Stone |
| 18 | 2.6 | 1.8 | 2.5 | Glass |
| 19 | 0.5 | 0.6 | 3.2 | Clay |
| 20 | 3 | 1.9 | 3.9 | Stone |
| 21 | 3.7 | 3.4 | 4.3 | Glass |
| 22 | 0.3 | 2.5 | 4.5 | Clay |
| 23 | 1.9 | 2.7 | 4.4 | Stone |
| 24 | 4.2 | 2.4 | 4.1 | Glass |
| 25 | 1.2 | 0.6 | 3.5 | Clay |
| 26 | 1.2 | 1.2 | 2.8 | Stone |
| 27 | 3.4 | 2.5 | 2.1 | Glass |
| 28 | 2.1 | 2.2 | 1.4 | Clay |
| 29 | 1.7 | 3.1 | 0.9 | Stone |
| 30 | 2.4 | 3.3 | 0.6 | Glass |
| 31 | 1.9 | 1.2 | 0.5 | Clay |
| 32 | 2.8 | 1.2 | 0.7 | Stone |
| 33 | 2.4 | 1.8 | 1.2 | Glass |
| 34 | 0.8 | 1.4 | 1.8 | Clay |
| 35 | 3.1 | 2.8 | 2.5 | Stone |
| 36 | 3.4 | 3.7 | 3.2 | Glass |
| 37 | 0.2 | 2.1 | 3.9 | Clay |
| 38 | 2.3 | 1.8 | 4.3 | Stone |
| 39 | 4.2 | 1.8 | 4.5 | Glass |
| 40 | 0.9 | 0.6 | 4.4 | Clay |
| 41 | 1.3 | 2 | 4.1 | Stone |
| 42 | 3.8 | 3.4 | 3.5 | Glass |
| 43 | 2 | 2.5 | 2.8 | Clay |
| 44 | 1.5 | 2.6 | 2.1 | Stone |
| 45 | 2.6 | 2.4 | 1.4 | Glass |
| 46 | 2.1 | 0.6 | 0.9 | Clay |
| 47 | 2.5 | 1.3 | 0.6 | Stone |
| 48 | 2.2 | 2.6 | 0.5 | Glass |
| 49 | 1.1 | 2.2 | 0.7 | Clay |
| 50 | 3.2 | 3.1 | 1.2 | Stone |
| 51 | 3 | 3.2 | 1.8 | Glass |
| 52 | 0.2 | 1.2 | 2.5 | Clay |
| 53 | 2.6 | 1.2 | 3.3 | Stone |
| 54 | 4 | 1.9 | 3.9 | Glass |
| 55 | 0.6 | 1.4 | 4.3 | Clay |
| 56 | 1.5 | 2.8 | 4.5 | Stone |
| 57 | 4 | 3.7 | 4.4 | Glass |
| 58 | 1.7 | 2 | 4.1 | Clay |
| 59 | 1.3 | 1.7 | 3.5 | Stone |
| 60 | 3 | 1.7 | 2.8 | Glass |
| 61 | 2.2 | 0.7 | 2.1 | Clay |
| 62 | 2.2 | 2 | 1.4 | Stone |
| 63 | 2.2 | 3.4 | 0.9 | Glass |
| 64 | 1.5 | 2.5 | 0.6 | Clay |
| 65 | 3.1 | 2.6 | 0.5 | Stone |
| 66 | 2.7 | 2.3 | 0.7 | Glass |
| 67 | 0.4 | 0.5 | 1.2 | Clay |
| 68 | 2.9 | 1.3 | 1.8 | Stone |
| 69 | 3.8 | 2.6 | 2.6 | Glass |
| 70 | 0.3 | 2.2 | 3.3 | Clay |
| 71 | 1.8 | 3.1 | 3.9 | Stone |
| 72 | 4.2 | 3.2 | 4.3 | Glass |
| 73 | 1.3 | 1.1 | 4.5 | Clay |
| 74 | 1.2 | 1.1 | 4.4 | Stone |
| 75 | 3.3 | 1.9 | 4.1 | Glass |
| 76 | 2.2 | 1.5 | 3.5 | Clay |
| 77 | 1.8 | 2.9 | 2.8 | Stone |
| 78 | 2.3 | 3.7 | 2.1 | Glass |
| 79 | 1.8 | 2 | 1.4 | Clay |
| 80 | 2.9 | 1.7 | 0.9 | Stone |
| 81 | 2.4 | 1.7 | 0.6 | Glass |
| 82 | 0.7 | 0.7 | 0.5 | Clay |
| 83 | 3.1 | 2.1 | 0.7 | Stone |
| 84 | 3.5 | 3.5 | 1.2 | Glass |
| 85 | 0.2 | 2.5 | 1.8 | Clay |
| 86 | 2.2 | 2.6 | 2.6 | Stone |
| 87 | 4.2 | 2.3 | 3.3 | Glass |
| 88 | 1 | 0.5 | 3.9 | Clay |
| 89 | 1.3 | 1.3 | 4.3 | Stone |
| 90 | 3.7 | 2.7 | 4.5 | Glass |
Model annotations
- Lid — Hinged at the back.
- Side — A handle was here.
- Front — The maker's mark.
Add it
npx shadcn@latest add @rivier-ui/pattern
The registry is named once in components.json: see Installation.
Example
Import it from @/components/layout/pattern.
<section className="relative overflow-hidden">
<Pattern variant="grid" />
<h2 className="relative">Plans</h2>
</section>
What it needs
Plain markup: it can stay a server component. No packages beyond React.
It imports
Source
The whole file. Once copied it is yours: the registry item holds the same text.
/**
* @name pattern
* @category layout
* @description A quiet background of dots, a grid or diagonal lines drawn in the theme's hairline colour, filling the box it sits in, behind the content and hidden from screen readers.
* @when A section or a card that needs a texture to set it apart without a colour or a gradient: a hero, an empty state, a canvas. Keep it faint; for a photograph or an illustration use an image.
* @example
* <section className="relative overflow-hidden">
* <Pattern variant="grid" />
* <h2 className="relative">Plans</h2>
* </section>
*/
import { useId, type ComponentProps } from "react";
import { cn } from "@/lib/cn";
export type PatternProps = Omit<ComponentProps<"svg">, "children"> & {
variant?: "dots" | "grid" | "lines";
/** The distance between marks in pixels. Default 20. */
size?: number;
};
export function Pattern({ variant = "dots", size = 20, className, ...props }: PatternProps) {
const id = `pattern-${useId().replace(/[^a-zA-Z0-9]/g, "")}`;
return (
<svg data-slot="pattern" aria-hidden="true" className={cn("pointer-events-none absolute inset-0 -z-10 size-full", className)} {...props}>
<defs>
<pattern id={id} width={size} height={size} patternUnits="userSpaceOnUse">
{variant === "dots" ? <circle cx={size / 2} cy={size / 2} r={1} className="fill-border-strong" /> : null}
{variant === "grid" ? <path d={`M${size} 0V${size}H0`} fill="none" className="stroke-border" strokeWidth={1} /> : null}
{variant === "lines" ? <path d={`M0 ${size}L${size} 0`} fill="none" className="stroke-border" strokeWidth={1} /> : null}
</pattern>
</defs>
<rect width="100%" height="100%" fill={`url(#${id})`} />
</svg>
);
}