Patterns
Tiled, themeable background layers — dots, grid lines, circuit traces or film grain.
Noise — A static film-grain overlay rendered from an SVG fractal-noise turbulence, with configurable opacity and blend mode.
Preview
<div class="relative h-40 w-full max-w-sm overflow-hidden rounded-lg bg-primary">
<x-ui.noise />
</div>
Installation
php artisan ui:add noise
Registry contract
php artisan ui:add noise
writes only the files below. The CLI validates each file hash before writing and asks before it replaces a local change, unless you pass --force.
-
resources/views/components/ui/noise.blade.php
- Registry dependencies
- None — installs on its own.
- Packages
-
composer: jml/brok:^0.2
Use with AI
A brief for your coding agent: install command, usage, props, guidance and the rules. Copy it, or open a prompt about this component in an assistant.
# Brok UI: Noise (`noise`)
A static film-grain overlay rendered from an SVG fractal-noise turbulence, with configurable opacity and blend mode.
Brok UI is a Laravel Blade component registry. Installed components are plain Blade files the app owns.
## Install
```bash
php artisan ui:add noise
```
## Usage
```blade
<div class="relative h-40 w-full max-w-sm overflow-hidden rounded-lg bg-primary">
<x-ui.noise />
</div>
```
## Props
- `opacity` (string, default `0.15`) — Opacity of the grain layer.
- `blend` (string, default `overlay`) — CSS mix-blend-mode used to composite the grain (overlay, multiply or soft-light).
## Use when
- Use only when visual expression supports storytelling, brand differentiation, or a clear showcase moment.
- Adding a subtle film-grain texture over a flat colour or gradient surface to break up banding.
- Wanting a static, zero-JS texture layer that costs nothing to animate because it never animates.
## Avoid when
- Do not place heavy effects in task-dense workflows where clarity, speed, and readability matter more.
- Wanting a repeating dot or line motif instead of grain; use dot-pattern or grid-pattern instead.
## Anti-patterns
- Heavy effects in forms or task-dense workflows
- Motion that interferes with reading or focus
## Rules
- Use the `<brok:noise>` tag (or `<x-ui.noise>`) in Blade; do not rewrite the component.
- Prefer the documented props and variants over utility-class overrides; when a utility must win, use the `!` important modifier.
- Use semantic design tokens (`bg-primary`, `text-muted-foreground`), never raw colour utilities.
- Keep the `data-slot` attributes; they are the styling and test hooks.
## Links
- Docs: https://brokui.dev/docs/components/noise
- Registry JSON (files, props, contract): https://brokui.dev/r/open/noise.json
Working in Claude Code, Cursor or Codex? Give the agent the whole registry through the MCP server or the Brok UI skill.
API
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| opacity | string | 0.15 | Opacity of the grain layer. |
| blend | string | overlay | CSS mix-blend-mode used to composite the grain (overlay, multiply or soft-light). |
Slots
default— Not used by this component; present for attribute-bag compatibility.
Data slots
Stable hooks for CSS overrides and browser tests.
Behavior
- Renders an inline, URL-encoded SVG feTurbulence fractalNoise filter as a background-image, with mix-blend-mode and opacity controlling how it interacts with content beneath it.
- Declares registry capability flags: a11y, responsive, rtl, darkMode, localized, reducedMotion.
Guidance
Support brand expression or a showcase moment.
Use when
- Use only when visual expression supports storytelling, brand differentiation, or a clear showcase moment.
- Adding a subtle film-grain texture over a flat colour or gradient surface to break up banding.
- Wanting a static, zero-JS texture layer that costs nothing to animate because it never animates.
Avoid when
- Do not place heavy effects in task-dense workflows where clarity, speed, and readability matter more.
- Wanting a repeating dot or line motif instead of grain; use dot-pattern or grid-pattern instead.
Use instead
- Static content-first presentation
Anti-patterns
- Heavy effects in forms or task-dense workflows
- Motion that interferes with reading or focus
- Anatomy
- Theming hooks
Accessibility
- Keyboard
- No component-owned keyboard interaction; native element behavior applies.
- Focus
none
- The layer is aria-hidden and pointer-events-none, purely decorative, and static — there is no motion to reduce.
- Semantic HTML and a stable
data-slotattribute for styling and scripting hooks. - Focus-visible rings use the
ringtoken, so keyboard focus is always visible. - Disabled and invalid states are conveyed to assistive tech, not by color alone.
- Targets WCAG 2.2 AA; verify contrast in light, dark, admin and customer surfaces in the preview.
- Labels go through
__()and layout uses logical properties (ms-*,text-start), so it mirrors underdir="rtl"— flip the preview to RTL to confirm. - Dark mode uses the same semantic tokens under the
darkclass; high contrast follows forced-color system tokens.
Livewire
Livewire can update this component through forwarded wire:* attributes.
Source
The exact, editable file ui:add writes
into your app. Previews render this same code; there are no preview-only components.
@props([
'opacity' => '0.15',
'blend' => 'overlay',
])
@php
// A static film-grain overlay. The grain is an inline SVG that paints an
// feTurbulence fractalNoise across a full-bleed rect — no raster asset and no
// animation (it is decorative: aria-hidden, pointer-events-none). The SVG is
// URL-encoded so it lives safely inside a data: URI. `mix-blend-mode` lets the
// grain interact with whatever sits beneath it; opacity keeps it subtle.
$blend = in_array($blend, ['overlay', 'multiply', 'soft-light'], true) ? $blend : 'overlay';
$svg = '<svg xmlns="http://www.w3.org/2000/svg" width="160" height="160">'
.'<filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="4" stitchTiles="stitch"/></filter>'
.'<rect width="100%" height="100%" filter="url(#n)"/></svg>';
$dataUri = 'data:image/svg+xml,'.rawurlencode($svg);
@endphp
<div
data-slot="noise"
aria-hidden="true"
style="background-image: url("{{ $dataUri }}"); mix-blend-mode: {{ $blend }}; opacity: {{ $opacity }};"
{{ $attributes->merge(['class' => 'pointer-events-none absolute inset-0']) }}
></div>
Ownership & lifecycle
Owner, release state, review evidence and adoption for this item.
- Owner
- Platform UI (@JoshJML)
- Current version
-
1.0.2 - Status
- Stable
- License
-
open - Accessibility reviewed
- No review date recorded
- Last breaking change
- No date recorded
- Deprecation
- Not deprecated
- Contract
-
v6 - Foundation
-
≥ 1.0.0