Updated
Scatter Text
Customize
Display2.0s
Wave speed1.25
Shimmer speed1.4
Shimmer width120px
Particles3000
Scatter min23px
Scatter max60px
Installation
npx shadcn@latest add https://uibrik.com/r/scatter-text.jsonAdd the cn helper
Imports
cnfrom@/lib/utils, whichshadcn initcreates. Add it by hand without shadcn.Copy the source into your project
components/uibrik/scatter-text/shatter-text.tsx"use client"; import { useEffect, useRef, useMemo } from "react"; import { cn } from "@/lib/utils"; // ─── Default Phrases ────────────────────────────────────────────────────────── export const DEFAULT_PHRASES = [ "Thinking...", "Processing...", "Reasoning...", "Analyzing...", "Computing...", "Understanding...", ]; // ─── Component Props ────────────────────────────────────────────────────────── export interface ShatterTextProps { /** * Phrases to cycle through. * Default: DEFAULT_PHRASES */ phrases?: string[]; /**
Adds the files to
components/uibrik/scatter-text. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/scatter-text.Usage
import { ShatterText } from "@/components/uibrik/scatter-text/shatter-text";const phrases = ["Generating prompt...", "Optimizing weights...", "Deploying model...", "Analyzing context...", "Processing input...", "Understanding intent...", "Retrieving context...", "Running inference...", "Evaluating response..."];<ShatterText phrases={phrases} displayDuration={2} waveSpeed={1.25} shimmerSpeed={1.4} shimmerWidth={120} particleCount={3000} scatterRadius={[20, 50]} textAlign="left" shimmer // color="…" // flightColor="…" // glowColor="…" // shimmerColor="…" // trigger={0}/>Where to use Scatter Text
Rotating headlines
Phrases shattering into particles that regroup make transitions dramatic.
Pairs with Particle Scatter
Tech brands
Particle text suits AI, science and data products.
Portfolio intros
A shattering reveal adds energy to a short introduction.
Props
ShatterText- phrases
- Type string[]
- ["Generating prompt...","Optimizing weights...","Deploying model...","Analyzing context...","Processing input...","Understanding intent...","Retrieving context...","Running inference...","Evaluating response..."]
- Phrases to cycle through.
- displayDuration
- Type number
- 2
- Seconds each phrase holds.
- waveSpeed
- Type number
- 1.25
- Speed of the scatter wave.
- shimmerSpeed
- Type number
- 1.4
- Speed of the shimmer sweep.
- shimmerWidth
- Type number
- 120
- Width of the shimmer beam.
- particleCount
- Type number
- 3000
- Particles sampled across the text.
- scatterRadius
- Type [number, number]
- [20, 50]
- Min and max scatter distance in px.
- color
- Type string
- –
- Base text colour; inherits from className when omitted.
- flightColor
- Type string
- –
- Particle colour while scattered.
- glowColor
- Type string
- –
- Colour at the peak of the wave.
- shimmerColor
- Type string
- –
- Shimmer highlight colour.
- textAlign
- Type "center" | "left" | "right"
- "center"
- Alignment inside the canvas.
- trigger
- Type number
- –
- When set, each change advances the phrase instead of a timer.
- shimmer
- Type boolean
- true
- Run the shimmer sweep while a phrase rests.
- className
- Type string
- –
- Container classes; colour, size, weight and family are read from them.