Text Shimmer Effect
The following shimmer effect is built for shadcn/ui-based projects. Installation, usage, and examples are given below.
Basic Shimmer Effect
Installation
Make sure you have set up a shadcn/ui project and have the cn helper function. If not, create one by asking your favourite LLM.
Paste the following code into your project.
Make sure the import paths match your project's structure.
Props & Usage
All props in this text shimmer effect are self-explanatory. However, the table below gives an overview of them and demonstrates how to change colors.
| Prop | Type | Default | Description |
|---|---|---|---|
as | ElementType | span | The element or component to render as. |
children | ReactNode | — | The text content to apply the shimmer effect to. |
ease | string | number[] | — | CSS timing function keyword (e.g. "linear", "ease-in-out") or a 4-number cubic-bezier array. |
duration in ms | number | 4000 | Duration of a single shimmer sweep, in milliseconds. |
interval in ms | number | 800 | Pause between sweeps, in milliseconds. |
iteration | string | number | "infinite" | Accepts any CSS animation-iteration-count value. |
textColor | string | — | Base text color. Accepts any CSS color value. |
shimmerColor | string | "var(--foreground)" | Color of the shimmer highlight that sweeps across the text. Accepts any CSS color value. |
shimmerWidth | string | "50px" | Half-width of the shimmer highlight band, as a CSS length. |
Examples
You can use the textColor property or bg-[...] className of Tailwind CSS to change the text color
And use the shimmerColor property to change the color of animating shimmer.
Various pricing cards built with the Cards component of shadcn/ui. Non-shadcn versions are included too.
You migh need a UI block
Last Update: 12 May 2026 at 10:40 AM