X Enterprises
nuxt-x-affiliate

Pattern Bg

Decorative SVG pattern layer — 13 tiles, tinted by the element's text colour.

Pattern Bg

A repeating decorative pattern for section backgrounds. Usually reached through <XAFSection :bg="{ pattern: 'grid' }"> rather than used directly.

The pattern is painted as a CSS mask over background-color: currentColor, so it inherits the element's text colour — tint it with an ordinary Tailwind class (text-primary-500, dark:text-white) and dark mode needs no special handling.

Components

<XAFPatternBg />

<div class="relative text-primary-500">
  <XAFPatternBg pattern="hexagons" :opacity="0.08" />
  <div class="relative z-10">Content above the pattern.</div>
</div>

Props

PropTypeDefaultDescription
pattern'dots' | 'grid' | 'diagonal' | 'topography' | 'circuit' | 'waves' | 'plaid' | 'diagonalPlaid' | 'hexagons' | 'triangles' | 'crosses' | 'zigzag' | 'diamonds''dots'Which tile to repeat
opacitynumber0.050–1. Patterns are decoration — keep it low
colorstring'auto''auto' inherits the text colour; any CSS colour also works
fadebooleantrueFade the pattern out at the top and bottom edges

AI Context

component: XAFPatternBg
package: "@xenterprises/nuxt-x-affiliate"
use-when: Decorative repeating pattern behind a section
Copyright © 2026