Meteor Stripes
Faint diagonal stripes where tiny shooting stars slide down the lines now and then. Put it behind a calm hero with one headline and one button.
Animations that blend right into your project.
Browse componentsnpx shadcn@latest add https://impeccable-ui.com/r/meteor-stripes.jsonRun it in a project set up with shadcn. No other packages needed. Or open and copy the file into components/ui/meteor-stripes.tsx.
Types
Two directions. Falling stars run from the top right down to the bottom left, like real shooting stars. Rising stars run the other way, up along the same stripes. Both previews below run a little busier than the default so you don't have to wait.
direction="down"direction="up"<MeteorStripes direction="down" /> // stars fall from the top right to the bottom left (the default)
<MeteorStripes direction="up" /> // stars rise from the bottom left to the top rightPrompts
Paste one into Claude Code, Cursor or any AI coding tool. Install adds this exact background and asks only which section it goes behind. Blend asks three short questions (where, which way and how many stars, and the color), then fits it to your brand without changing how the stars move.
# Meteor Stripes
A 1-file React component from Impeccable. Add it to this project so it works and looks exactly like the source below, in the one place I choose, and change nothing else.
A very faint background of thin diagonal stripes. Now and then a tiny shooting star lights up on one stripe, slides along that exact stripe with a short fading tail, slows a little and fades away. It sits behind the content and never catches a click.
## Before you build: one question
Look through this project first: its landing and hero sections, its sign-up and pricing sections, its root layout and which sections have plain, empty backgrounds. Then ask me this in one message and wait for my answer:
- **Where should it go?** Suggest the 1–3 sections it fits best behind (for example the hero, or the sign-up section), or the whole page. For a section, keep its content and wrap it in the stripes. For the whole page, it goes once in the root layout, fixed to the screen. I can pick one or name another.
*Why: the stripes are faint and the stars are small, so they suit a calm section with a short headline and room around it, not a busy one full of cards and images.*
Ask nothing else. If I say *skip*, use the best suggestion.
## Keep it as it is
The faint 45 degree stripes, the tiny stars that run only along a stripe in its own direction, their short fading tails and the calm, random pace are the design. Keep them exactly as in the source, with the default props. If something doesn't fit my project, tell me instead of changing it.
- Add only the component file and the one place I picked. If it wraps an existing section, keep that section's content, spacing and background color. Don't add packages, change other files, or restyle anything.
- Don't add the demo parts from the Impeccable website: the "Animations that blend right into your project." headline, its Browse components pill, the Falling and Rising cards, or the busier stars used on the home screen.
## Fastest path
If this project has a `components.json` (shadcn), run `npx shadcn@latest add https://impeccable-ui.com/r/meteor-stripes.json`.
If the command succeeds, only fix import paths to match this project and skip ahead. If it fails or there is no `components.json`, build it by hand as below.
## Build it
- Stack: React 18 or 19 with TypeScript. No other packages: the stripes and stars are drawn on two plain canvases, and the rest is a few lines of CSS.
- JavaScript project? Name the file `meteor-stripes.jsx` and remove the type annotations; nothing else changes.
- Create this file, in this project's usual place for components:
- `components/ui/meteor-stripes.tsx`
- Keep these exports and their names: `MeteorStripes`, `MeteorStripesProps`, `MeteorStripesDirection`.
- Keep `"use client"` at the top in Next.js App Router projects. In other setups it is harmless.
- Keep the tuning values at the top exactly as written: `LINE_W`, `LINE_A`, `STAR_A`, `HEAD_R`, `GLOW_R`, `GLOW_A`, `TAIL_MIN`, `TAIL_MAX`, `SPEED_MIN`, `SPEED_MAX`, `RUN_MIN`, `RUN_MAX`, `EASE`, `FADE_IN`, `FADE_OUT`, `RATE`, `RATE_MIN`, `FIRST_MS`, `MAX_STARS`, `MAX_PIXELS` and the `CSS` block. They are the design.
- Keep the fallbacks: with `prefers-reduced-motion: reduce` only the stripes show, no stars. Off screen and in a background tab nothing runs.
- Keep the stripes out of the way: `pointer-events: none`, `user-select: none` and `aria-hidden` on their layer. They must never catch a click, a text selection or a screen reader.
## Use it
```tsx
"use client";
import { MeteorStripes } from "@/components/ui/meteor-stripes";
// Behind one section: wrap its content and give it a size.
export function Hero() {
return (
<MeteorStripes className="flex min-h-[560px] flex-col items-center justify-center gap-6 px-6">
<h1>Animations that blend right in</h1>
<a href="/components">Browse components</a>
</MeteorStripes>
);
}
// Behind the whole page: once in the root layout, empty, fixed to the screen.
<MeteorStripes className="fixed inset-0 -z-10" />
```
- It is a `<div>` and takes every div prop. `className` and `style` go on the box: give it a size (or let it fill its parent) and, if you want one, a background color. The stripes have none.
- Everything inside it sits above the stripes and works as normal. Keep the section's own tag and landmarks (`<section>`, `<main>`) inside it, or wrap the stripes inside the section.
- For a whole page, keep it empty and fixed, so it stays one screen big however long the page is.
## How the stars move
Read this before you touch anything, so you know what the code does and why it must stay as it is.
1. **The stripes.** Thin 1px lines at 45 degrees, running from the bottom left to the top right, one every `gap` px (12) measured straight across them, centred in the box. They are drawn at 7% of `color` (the text color by default), so they are felt more than seen. They have no background of their own.
2. **The layer.** The box is `position: relative` with `isolation: isolate`. The two canvases sit in a layer at `z-index: -1` inside it, so everything passed as children always paints above the stripes, and the box's own background color paints below them. The layer has `pointer-events: none`, so clicks and selection go straight to the content.
3. **A star.** A star is picked at a random spot and snapped onto the nearest stripe, so it always sits exactly on a line. It is as thin as the stripe (1px), with a small round head (70% of `color`, a soft glow only 3.5px wide so it never spills onto the next stripe) and a tail 56 to 120px long that fades to nothing behind it. It runs along its stripe in the stripe's own direction: `direction="down"` falls from the top right to the bottom left, `"up"` rises the other way.
4. **Its run.** Each star runs 150 to 340px, starting at 220 to 380px a second and slowing into the end of its run. Its tail grows out of the head as it starts; it lights up over the first 14% of the run and fades out over the last 45%.
5. **How often.** Stars come at random, about 0.85 a second on a 1280 x 720 box at `density` 1, fewer on a smaller box (never fewer than 0.22 a second), and never more than 8 at once. The first one comes half a second after the box appears.
6. **Drawing.** The stripes are drawn once, and again only on resize, zoom or a theme change. Each frame only the small boxes around the stars are cleared and redrawn. All timing runs on elapsed time, so it moves the same on slow phones and fast screens. The canvases are at most 2x the screen's pixel ratio, and the color is read from the page again when the theme changes, so it follows light and dark mode.
## Check
- It type-checks and the page renders with no console errors.
- At rest the stripes are thin, faint and diagonal (bottom left to top right), about 12px apart. Within a few seconds a tiny star with a short tail runs down one stripe from the top right toward the bottom left, staying exactly on that stripe, then fades. About one star a second on a laptop screen, never a crowd. Text on top can still be selected and every button and link on top still works.
- It looks right in light and dark mode (check both): dark stripes and stars on a light page, light ones on a dark page.
- On a phone the stripes and stars show the same way, the page scrolls normally, and there is no sideways scroll.
- With `prefers-reduced-motion: reduce`, only the stripes show, with no stars.
- Nothing else on the site looks or behaves differently.
- Finish with a short report: the files you added or changed, where it's placed, and every place where you had to do something differently from the source, and why.
## Source
The reference implementation. Copy it as-is, then apply only the changes listed above.
### `components/ui/meteor-stripes.tsx`
```tsx
"use client";
/**
* Meteor Stripes, from Impeccable.
*
* A very faint background of thin diagonal stripes. Now and then a tiny
* shooting star runs down one of the stripes: it lights up out of nowhere,
* slides along that exact stripe in the stripe's own direction with a short
* fading tail, slows a little and fades away. It never leaves its stripe.
*
* It sits behind whatever you put inside it. It is never selectable, never
* catches a click, and is hidden from screen readers.
*
* No packages. Two canvases: the stripes are drawn once (again only on resize or
* a theme change), and only the small boxes around the stars are redrawn each
* frame. Stars only run while the box is near the screen and the tab is open.
* With reduced motion the stripes stay and the stars are off.
*/
import { useEffect, useRef, type HTMLAttributes, type ReactNode } from "react";
export type MeteorStripesDirection = "down" | "up";
export type MeteorStripesProps = Omit<HTMLAttributes<HTMLDivElement>, "color"> & {
/** Which way the stars run along the stripes: "down" falls from the top right to the bottom left, "up" rises the other way. */
direction?: MeteorStripesDirection;
/** Distance between stripes, in px, measured straight across the box. */
gap?: number;
/** How many stars: 1 is the default, 2 twice as many, 0 turns them off. Always scaled to the size of the box. */
density?: number;
/** Color of the stripes and the stars. Stripes are drawn at 7% of it, stars at up to 70%. Any CSS color, including var(--…). Default: the text color. */
color?: string;
/** Your content. It sits above the stripes and works as normal. */
children?: ReactNode;
};
/* ---------- tuning (the design: keep as written) ---------- */
const LINE_W = 1; // px: thickness of a stripe, and of a star's tail
const LINE_A = 0.07; // how strong a stripe is (share of its color)
const STAR_A = 0.7; // how strong a star's head is
const HEAD_R = 1.1; // px: radius of a star's head
const GLOW_R = 3.5; // px: soft glow around the head, small enough to stay on its stripe
const GLOW_A = 0.3; // how strong that glow is
const TAIL_MIN = 56; // px: shortest tail
const TAIL_MAX = 120; // px: longest tail
const SPEED_MIN = 220; // px/s: slowest star, at the start of its run
const SPEED_MAX = 380; // px/s: fastest star
const RUN_MIN = 150; // px: shortest run along a stripe
const RUN_MAX = 340; // px: longest run
const EASE = 1.6; // how much a star slows toward the end of its run (1 = not at all)
const FADE_IN = 0.14; // share of the run spent lighting up
const FADE_OUT = 0.45; // share of the run spent fading away, at the end
const RATE = 1.2; // stars per second for a 1280 x 720 box at density 1 (it follows the square root of the area, so small boxes stay lively)
const RATE_MIN = 0.4; // stars per second, however small the box
const FIRST_MS = 500; // the first star comes this soon after the box appears
const MAX_STARS = 8; // never more than this many at once
const MAX_PIXELS = 8_000_000; // canvas size budget; a very large box draws a little softer instead of running out of memory
const CSS = `
:where(.ims) { position: relative; isolation: isolate; }
.ims-layer { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ims-layer canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; pointer-events: none; }`;
/* ---------- small helpers ---------- */
const num = (v: unknown, fallback: number, min: number, max: number) =>
typeof v === "number" && Number.isFinite(v) ? Math.min(max, Math.max(min, v)) : fallback;
const rand = (a: number, b: number) => a + Math.random() * (b - a);
type RGBA = [number, number, number, number];
/** Any CSS color as [r, g, b, a], worked out by painting it, so every color format works (rgb, oklch, color()...). */
let probe: CanvasRenderingContext2D | null = null;
function toRgba(color: string): RGBA {
probe ??= document.createElement("canvas").getContext("2d", { willReadFrequently: true });
if (!probe) return [128, 128, 128, 1];
probe.clearRect(0, 0, 1, 1);
probe.fillStyle = "#808080";
probe.fillStyle = color;
probe.fillRect(0, 0, 1, 1);
const [r, g, b, a] = probe.getImageData(0, 0, 1, 1).data;
return [r, g, b, a / 255];
}
/** One star: it runs along the stripe x + y = c, from (x0, y0), `run` px in total. */
type Star = { x0: number; y0: number; run: number; tail: number; v: number; t: number; dur: number };
type Box = { x0: number; y0: number; x1: number; y1: number };
/* ---------- the background ---------- */
export function MeteorStripes({
direction = "down",
gap = 12,
density = 1,
color,
className,
children,
...rest
}: MeteorStripesProps) {
const rootRef = useRef<HTMLDivElement>(null);
const layerRef = useRef<HTMLDivElement>(null);
const linesRef = useRef<HTMLCanvasElement>(null);
const starsRef = useRef<HTMLCanvasElement>(null);
const refresh = useRef<() => void>(() => {});
// Props the running code reads without starting over.
const opts = useRef({ direction, gap, density, color });
opts.current = {
direction: direction === "up" ? "up" : "down",
gap: num(gap, 12, 4, 200),
density: num(density, 1, 0, 10),
color,
};
useEffect(() => {
refresh.current();
}, [direction, gap, density, color]);
useEffect(() => {
const root = rootRef.current, layer = layerRef.current;
const lines = linesRef.current, sky = starsRef.current;
if (!root || !layer || !lines || !sky) return;
const lctx = lines.getContext("2d"), ctx = sky.getContext("2d");
if (!lctx || !ctx) return;
const reduceMq = matchMedia("(prefers-reduced-motion: reduce)");
let still = reduceMq.matches; // reduced motion: stripes only, no stars
let w = 0, h = 0, dpr = 1, G = 12, c0 = 0;
let rgb = "128 128 128", alpha = 1;
let sprite: HTMLCanvasElement | null = null;
let stars: Star[] = [];
let drawn: Box[] = [];
let raf = 0, last = 0, visible = false, ready = false, nextIn = FIRST_MS;
const readColor = () => {
layer.style.color = opts.current.color ?? "";
const [r, g, b, a] = toRgba(getComputedStyle(layer).color);
layer.style.color = "";
rgb = `${r} ${g} ${b}`;
alpha = a;
// One soft round glow, drawn once and stamped under each head.
sprite ??= document.createElement("canvas");
sprite.width = sprite.height = 32;
const s = sprite.getContext("2d");
if (s) {
const grad = s.createRadialGradient(16, 16, 0, 16, 16, 16);
grad.addColorStop(0, `rgb(${rgb} / ${a})`);
grad.addColorStop(0.45, `rgb(${rgb} / ${a * 0.3})`);
grad.addColorStop(1, `rgb(${rgb} / 0)`);
s.clearRect(0, 0, 32, 32);
s.fillStyle = grad;
s.fillRect(0, 0, 32, 32);
}
};
const layout = () => {
w = root.offsetWidth;
h = root.offsetHeight;
// The gap is measured straight across the stripes; along the top edge that is gap x √2.
G = opts.current.gap * Math.SQRT2;
const want = Math.min(window.devicePixelRatio || 1, 2);
dpr = w * h * want * want > MAX_PIXELS ? Math.max(0.5, Math.sqrt(MAX_PIXELS / Math.max(1, w * h))) : want;
const cw = Math.max(1, Math.round(w * dpr)), ch = Math.max(1, Math.round(h * dpr));
for (const c of [lines, sky]) {
if (c.width !== cw) c.width = cw;
if (c.height !== ch) c.height = ch;
}
// Stripes are centred in the box, so they look the same at both sides.
c0 = ((w + h) / 2) % G;
};
/** The stripes: x + y = c0 + k * G, edge to edge. */
const drawLines = () => {
lctx.setTransform(1, 0, 0, 1, 0, 0);
lctx.clearRect(0, 0, lines.width, lines.height);
lctx.setTransform(dpr, 0, 0, dpr, 0, 0);
lctx.strokeStyle = `rgb(${rgb} / ${(alpha * LINE_A).toFixed(3)})`;
lctx.lineWidth = LINE_W;
lctx.beginPath();
for (let c = c0 - G; c <= w + h + G; c += G) {
lctx.moveTo(c + 1, -1);
lctx.lineTo(-1, c + 1);
}
lctx.stroke();
};
// Where a star's head is, how long its tail is right now, and how bright it is.
const dirX = () => (opts.current.direction === "up" ? 1 : -1) / Math.SQRT2;
const state = (s: Star) => {
const p = Math.min(1, s.t / s.dur);
const d = s.run * (1 - (1 - p) ** EASE); // eases out: quick start, slows into the end
const dx = dirX();
const hx = s.x0 + dx * d, hy = s.y0 - dx * d;
const tail = Math.min(s.tail, d); // the tail grows out of the head as it starts
const a = p < FADE_IN ? p / FADE_IN : p > 1 - FADE_OUT ? (1 - p) / FADE_OUT : 1;
const k = a * a * (3 - 2 * a); // soft in and out
return { hx, hy, tx: hx - dx * tail, ty: hy + dx * tail, k };
};
const starBox = (s: Star): Box => {
const { hx, hy, tx, ty } = state(s);
const m = GLOW_R + 2;
return { x0: Math.min(hx, tx) - m, y0: Math.min(hy, ty) - m, x1: Math.max(hx, tx) + m, y1: Math.max(hy, ty) + m };
};
const clearBox = (b: Box) => {
const X0 = Math.max(0, Math.floor(b.x0 * dpr)), Y0 = Math.max(0, Math.floor(b.y0 * dpr));
const X1 = Math.min(sky.width, Math.ceil(b.x1 * dpr)), Y1 = Math.min(sky.height, Math.ceil(b.y1 * dpr));
if (X1 > X0 && Y1 > Y0) ctx.clearRect(X0, Y0, X1 - X0, Y1 - Y0);
};
const clearAll = () => {
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.clearRect(0, 0, sky.width, sky.height);
drawn = [];
};
const drawStar = (s: Star) => {
const { hx, hy, tx, ty, k } = state(s);
if (k <= 0.002) return;
const a = alpha * STAR_A * k;
if (Math.abs(hx - tx) > 0.01) {
const grad = ctx.createLinearGradient(hx, hy, tx, ty);
grad.addColorStop(0, `rgb(${rgb} / ${a.toFixed(3)})`);
grad.addColorStop(0.25, `rgb(${rgb} / ${(a * 0.45).toFixed(3)})`);
grad.addColorStop(1, `rgb(${rgb} / 0)`);
ctx.strokeStyle = grad;
ctx.lineWidth = LINE_W;
ctx.lineCap = "round";
ctx.beginPath();
ctx.moveTo(hx, hy);
ctx.lineTo(tx, ty);
ctx.stroke();
}
if (sprite) {
ctx.globalAlpha = GLOW_A * k;
ctx.drawImage(sprite, hx - GLOW_R, hy - GLOW_R, GLOW_R * 2, GLOW_R * 2);
ctx.globalAlpha = 1;
}
ctx.fillStyle = `rgb(${rgb} / ${a.toFixed(3)})`;
ctx.beginPath();
ctx.arc(hx, hy, HEAD_R, 0, Math.PI * 2);
ctx.fill();
};
/** A new star on a random stripe, somewhere in the box (a little past the edges too, so some slide in). */
const spawn = () => {
if (stars.length >= MAX_STARS || w < 8 || h < 8) return;
const run = rand(RUN_MIN, RUN_MAX);
let x = rand(-0.1 * w, 1.1 * w), y = rand(-0.1 * h, 1.1 * h);
// Snap onto the nearest stripe, sliding along x - y so the spot stays where it was picked.
const c = c0 + Math.round((x + y - c0) / G) * G;
const shift = (c - (x + y)) / 2;
x += shift;
y += shift;
const v = rand(SPEED_MIN, SPEED_MAX);
// An eased run of `run` px that starts at v px/s lasts EASE * run / v.
stars.push({ x0: x, y0: y, run, tail: rand(TAIL_MIN, TAIL_MAX), v, t: 0, dur: (EASE * run) / v });
};
const rate = () => {
const d = opts.current.density;
if (d <= 0) return 0;
return Math.max(RATE_MIN, RATE * Math.sqrt((w * h) / (1280 * 720))) * d;
};
const frame = (now: number) => {
raf = 0;
const dt = Math.min(64, last ? now - last : 16) / 1000;
last = now;
// New stars arrive at random, on average `rate` a second.
const r = rate();
if (r > 0) {
nextIn -= dt * 1000;
while (nextIn <= 0) {
spawn();
nextIn += Math.max(120, (-Math.log(1 - Math.random()) / r) * 1000);
}
}
for (const s of stars) s.t += dt;
stars = stars.filter((s) => s.t < s.dur);
ctx.setTransform(1, 0, 0, 1, 0, 0);
for (const b of drawn) clearBox(b);
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
drawn = stars.map(starBox);
for (const s of stars) drawStar(s);
if (running()) raf = requestAnimationFrame(frame);
else last = 0;
};
const running = () => ready && visible && !still && !document.hidden && (rate() > 0 || stars.length > 0);
const wake = () => {
if (!raf && running()) {
last = 0;
raf = requestAnimationFrame(frame);
}
};
const stop = () => {
cancelAnimationFrame(raf);
raf = 0;
last = 0;
stars = [];
clearAll();
};
const paintAll = () => {
if (!ready) return;
layout();
readColor();
drawLines();
// Stars already running keep their stripe only if the stripes did not move; simplest is to let them go.
stars = [];
clearAll();
nextIn = Math.min(nextIn, FIRST_MS);
if (still) stop();
wake();
};
// Browser zoom changes the pixel ratio without changing the box size.
let lastDpr = window.devicePixelRatio;
const onResize = () => {
if (window.devicePixelRatio !== lastDpr) {
lastDpr = window.devicePixelRatio;
paintAll();
}
};
const onReduce = () => {
still = reduceMq.matches;
if (still) stop();
else wake();
};
const onVisibility = () => {
if (document.hidden) {
cancelAnimationFrame(raf);
raf = 0;
} else wake();
};
window.addEventListener("resize", onResize);
reduceMq.addEventListener("change", onReduce);
document.addEventListener("visibilitychange", onVisibility);
// Draws only once it comes near the screen; stars only run while it is there.
const io = new IntersectionObserver(
([entry]) => {
visible = entry.isIntersecting;
if (visible && !ready) {
ready = true;
paintAll();
}
if (!visible) stop();
else wake();
},
{ rootMargin: "100px" },
);
io.observe(root);
let lastW = -1, lastH = -1;
const ro = new ResizeObserver(() => {
if (root.offsetWidth === lastW && root.offsetHeight === lastH) return;
lastW = root.offsetWidth;
lastH = root.offsetHeight;
paintAll();
});
ro.observe(root);
// Colors follow the theme: a class or data-theme change on the page, or the system switching.
const mo = new MutationObserver(paintAll);
mo.observe(document.documentElement, { attributes: true, attributeFilter: ["class", "style", "data-theme"] });
const darkMq = matchMedia("(prefers-color-scheme: dark)");
darkMq.addEventListener("change", paintAll);
refresh.current = paintAll;
return () => {
refresh.current = () => {};
cancelAnimationFrame(raf);
window.removeEventListener("resize", onResize);
reduceMq.removeEventListener("change", onReduce);
document.removeEventListener("visibilitychange", onVisibility);
darkMq.removeEventListener("change", paintAll);
io.disconnect();
ro.disconnect();
mo.disconnect();
};
}, []);
return (
<div ref={rootRef} className={className ? `ims ${className}` : "ims"} {...rest}>
<style>{CSS}</style>
<div ref={layerRef} className="ims-layer" aria-hidden="true">
<canvas ref={linesRef} width={0} height={0} />
<canvas ref={starsRef} width={0} height={0} />
</div>
{children}
</div>
);
}
export default MeteorStripes;
```
Usage
Wrap a section's content in it and give it a size. Everything inside sits above the stripes.
"use client";
import { MeteorStripes } from "@/components/ui/meteor-stripes";
export function Hero() {
return (
<MeteorStripes className="flex min-h-[560px] flex-col items-center justify-center gap-6 bg-background px-6">
<h1 className="text-5xl font-semibold tracking-tight">Animations that blend right in</h1>
<a href="/components" className="rounded-full border px-5 py-2.5">
Browse components
</a>
</MeteorStripes>
);
}For a whole page, leave it empty and fix it to the screen, so it stays one screen big however long the page is.
// Behind a whole page: fixed to the screen, under everything.
<MeteorStripes className="fixed inset-0 -z-10" />How it moves
At rest it is a field of thin diagonal stripes, so faint you almost only feel them. Every gap px there is one stripe, running from the bottom left to the top right.
Now and then a star lights up on one stripe, at a random spot. It is exactly as thin as the stripe, with a small bright head and a short tail that fades behind it, so it never leaves its line. It starts quick, slows a little toward the end of its run, and fades out after a few hundred px. Stars come at random, about one a second on a laptop screen, and fewer on a small box, so it stays calm. It never reacts to the pointer and never catches a click or a text selection. It works the same on phones. With reduced motion only the stripes show. Nothing runs while it is off screen or the tab is in the background.
Props
| Prop | Default | What it does |
|---|---|---|
direction | "down" | Which way the stars run along the stripes: "down" falls from the top right to the bottom left, "up" rises the other way. |
gap | 12 | Distance between stripes, in px, measured straight across them (4 to 200). The stripes are centred, so both sides match. |
density | 1 | How many stars. 2 is twice as many, 0 turns them off and leaves only the stripes. Always scaled to the size of the box, so a small card isn't crowded. |
color | the text color | Color of the stripes and the stars. Stripes are drawn at 7% of it and a star's head at 70%, so pass a full color. |
children | — | Your content. It sits above the stripes and works as normal: text can be selected and buttons clicked. |
className / style | — | On the box. Give it a size (or fill its parent), and a background color if you want one: the stripes have none. |