How to use the SVG pattern generator
- Pick a pattern from the gallery: dots, lines, shapes, geometric or wavy.
- Set the tile size: the distance before the pattern repeats.
- Set the element size and line width to make dots bigger or lines bolder.
- Choose colors: pattern color, its opacity and the background.
- Export CSS (background-color plus background-image), SCSS variables, the SVG tile, or Tailwind arbitrary values.
How it works
The generator writes a small SVG, for example a single circle in a 24 × 24 tile for dots, and URL-encodes it into a data: URI:
background-color: #FFFFFF;
background-image: url("data:image/svg+xml,%3Csvg …%3E");
background-repeat defaults to repeat, so the tile fills the element. Hexagons use a wider tile (three radii by √3 radii) because a honeycomb only repeats after two offset columns.
Worked examples
Example 1: a subtle section background
Load Dots dense and set the opacity to around 0.15. On a white or light grey section, it adds texture without competing with content. Put cards or text panels on top with solid backgrounds.
Example 2: a blueprint header
Load Blueprint: white graph-paper lines at 35% opacity on deep blue. It’s perfect for developer tools, engineering products and documentation headers. Increase the tile size for a calmer grid.
Example 3: a warning stripe
Load Diagonal bold: thick yellow diagonal stripes on near-black, the classic “caution” look. Use it sparingly, for example as a thin banner across the top of a staging site.
Tips
- Smaller tiles feel busier. Start large and scale down.
- Use the same pattern color as your brand accent at low opacity for a cohesive look.
- Animate a pattern by moving its
background-positionwith a long, slow animation. Remember a reduced-motion rule. - The SVG tile export works as an image in design tools such as Figma.
Common mistakes
- Patterns that are too strong. Background patterns should stay in the background. If people notice the pattern before the content, lower the opacity.
- Tiny tiles with thick lines. They create a shimmering effect on some screens. Increase the tile size.
Patterns also work well as subtle placeholders in empty states, image slots and loading areas, where a plain grey box would look unfinished.