Skip to content

Text Shimmer

Loading/live text effect: a light band sweeps across muted text using a clipped gradient. For "thinking…", "generating…" or live status labels. Pure CSS, server-safe.

minimal/effect/text-shimmer
Open ↗

Source

import type { CSSProperties, ElementType, ReactNode } from "react";
import { cn } from "@/lib/utils";

export interface TextShimmerProps {
  children: ReactNode;
  as?: ElementType;
  /** Seconds per sweep. */
  duration?: number;
  className?: string;
}

/**
 * Text effect: a light band sweeps across muted text — for "thinking…",
 * "generating…" or live labels. Pure CSS (keyframes shipped inline).
 */
export function TextShimmer({ children, as: Tag = "span", duration = 2.2, className }: TextShimmerProps) {
  return (
    <>
      <Tag
        className={cn(
          "inline-block bg-clip-text text-transparent [background-size:250%_100%] [background-image:linear-gradient(90deg,var(--da-muted-fg)_35%,var(--da-fg)_50%,var(--da-muted-fg)_65%)] motion-safe:animate-[da-shimmer_var(--shimmer-d)_linear_infinite]",
          className,
        )}
        style={{ "--shimmer-d": `${duration}s` } as CSSProperties}
      >
        {children}
      </Tag>
      <style href="da-shimmer" precedence="default">{`@keyframes da-shimmer { from { background-position: 100% 0 } to { background-position: 0% 0 } }`}</style>
    </>
  );
}

export default TextShimmer;

modules/minimal/effect/text-shimmer/index.tsx

Props

PropTypeDefaultDescription
children*ReactNode—Text to shimmer.
asElementType"span"Rendered element.
durationnumber2.2Seconds per sweep.
classNamestring—Extra classes (size, weight).

Other text variants in Minimal

Text in other art directions

Animated

Glitch Text

Print-misregistration glitch: two offset copies of the text in accent and secondary colors jitter in horizontal slices, constantly or only on hover/focus. Pure CSS, blend mode adapts to dark.

BrutalistText
Animated

Marquee Band

Tilted full-bleed ticker band with giant uppercase words scrolling infinitely between ruled strokes. Seamless loop, direction and speed props, three color tones.

BrutalistText
Animated

Scramble Text

Decoder-style mono text: random glyphs resolve left to right into the final string when it scrolls into view, and again on hover or focus. Great for version numbers, stats and labels.

BrutalistText
Animated

Typewriter Text

Headline with a static prefix and a rotating last word that is typed character by character, held, deleted and replaced, followed by a blinking block cursor.

BrutalistText
Animated

Digit Roll

Odometer-style number: each digit rolls vertically through 0–9 to its value (staggered from the left) when it enters the viewport, in tabular display figures.

Mono CleanText
Animated

Outline Fill

Outlined display text (hairline stroke, transparent fill) that fills solid ink from bottom to top on hover/focus via a clipped duplicate layer — for big navigation links. Pure CSS.

Mono CleanText
Animated

Scramble Text

Mono text that resolves from random glyphs to the real string left-to-right when it enters the viewport (and again on hover); final text is always exposed to assistive tech.

Mono CleanText
Animated

Tracking In

Headline whose letter-spacing contracts from very wide to the tight display tracking while fading in — a calm, precise entrance for short words.

Mono CleanText
Animated

Count Up

Number that counts up with an ease-out when scrolled into view, formatted with thousands separators (prefix/suffix, decimals); tabular figures prevent jitter. Final value for screen readers.

Neo CorporateText
Animated

Shimmer Text

Text filled with a primary→accent-fg gradient and a slow light sweep passing across it every few seconds — for a single highlighted phrase in a headline. Pure CSS.

Neo CorporateText
Animated

Typed Words

Headline with a rotating keyword typed and erased character by character in primary, with a blinking caret; reduced motion swaps whole words. Full sentence exposed to screen readers.

Neo CorporateText
Animated

Word Reveal

Headline whose words slide up from behind a mask one after another when scrolled into view — crisp, no blur or bounce. The element keeps its plain text for screen readers.

Neo CorporateText
Animated

Drawn Underline

Hand-drawn underline that draws itself (SVG pathLength) beneath a word when it scrolls into view — a loose, slightly wavy pen stroke.

Organic SoftText
Animated

Italic Swap

Headline with a rotating italic serif word: each word slides up out of a mask and the next rises in with a soft ease; the full sentence is available to screen readers.

Organic SoftText
Animated

Letter Rise

Letters drift up from below with a gentle fade, one after another like seeds sprouting, when the text scrolls into view; words never break mid-letter.

Organic SoftText
Animated

Marker Highlight

Highlighter-pen effect: a soft tinted band sweeps left-to-right behind the words when they scroll into view; works across line wraps (box-decoration-break) and text stays fully legible.

Organic SoftText
Animated

Emoji Swap

Headline whose last word is a pastel pill (emoji + word) that pops out and swaps to the next one on an interval — teams, freelancers, students…

Soft FlatText
Animated

Highlight Text

Marker highlight that draws itself behind a word or phrase — left to right, slightly tilted and rounded — when it scrolls into view; four pastel tones.

Soft FlatText
Animated

Rolling Number

Odometer-style number: each digit rolls vertically to its value with a staggered bounce, on first view and whenever the value changes.

Soft FlatText
Animated

Wave Text

Bouncy text where letters hop one after another in a wave — always, or on hover/focus of the text or a parent .group. Pure CSS.

Soft FlatText