Skip to content

Text shimmer

Show ongoing work with a calm light across the words.

TextMotionLoading
npx shadcn@latest add @silicon-ui/text-shimmer

Installation

With the shadcn CLI

npx shadcn@latest add @silicon-ui/text-shimmer

Manually

  1. Install the dependencies

    npm install motion
  2. Copy these files into your project

    • components/silicon-ui/text-shimmer/text-shimmer.tsx
    • components/silicon-ui/text-shimmer/text-shimmer.module.css
  3. Add the foundation, once per app, for the design and motion tokens

    npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

usage.tsx
import { TextShimmer } from "@/components/silicon-ui/text-shimmer/text-shimmer";

API reference

PropTypeDefault
children*

The status text. Keep it to one short line.

string—
active

Sweep while work is ongoing. Defaults to true.

booleantrue
duration

Seconds for one sweep across the text. Defaults to 1.8.

number1.8
as"span" | "p" | "div" | "h2" | "h3" | "h4""span"
classNamestring—
idstring—

Dependencies

npm
motion
Registry
silicon-motion-tokens