Tailwind CSS v4 Plugin

tw-shimmer

Zero-dependency CSS-only shimmer. Simple, beautiful, and lightweight.

Installation

npm install tw-shimmer
app/globals.css

Text Shimmer

Add shimmer effects to text elements.

💡 Important

You won't see the shimmer if your text color is black. Set a lighter or semi-transparent text color.

shimmer

Base utility for shimmer effect. Requires text color to be visible.

Shimmer Effect

shimmer-invert

Fades text lighter instead. Allows you to use darker text colors and still get a stark shimmer effect.

Shimmer Effect

Automatic Color

Shimmer automatically picks a color based on your text color.

Blue Shimmer

shimmer-color-{color}

Override the automatic color with a custom shimmer color.

Orange Shimmer

shimmer-spread-{value}

Width of the shimmer highlight in pixels. Default: 120px.

Shimmer Effect (60px)Shimmer Effect (120px)Shimmer Effect (200px)

shimmer-angle-{value}

Angle of the shimmer sweep in degrees. Default: 15deg (resulting in a 105deg gradient). Higher values create a more diagonal sweep.

Shimmer Effect (0deg)Shimmer Effect (15deg)Shimmer Effect (75deg)

Animation Timing

Control how long the shimmer animation takes.

Total animation cycle

shimmer animation
(duration or speed)
+
repeat delay
(default: 1000ms)

Option A

shimmer-duration-{ms}

Fixed duration in milliseconds. Larger elements will appear to move faster since they cover more distance in the same time.

ShortMedium Length TextThis Is A Much Longer Text

Same duration, different perceived speeds

Option B

shimmer-speed-{px/s}

Speed in pixels per second. All elements sweep at the same visual speed regardless of width. Default: 200px/s.

ShortMedium Length TextThis Is A Much Longer Text

Same speed, different durations

Width Required for shimmer-speed

CSS can't read text width, so you need to measure it with JavaScript and pass it in. Without it, defaults to 200px.

style={{ "--shimmer-track-width": width }}

shimmer-repeat-delay-{value}

Delay between animation cycles in milliseconds. Default: 1000ms. Use 0 for continuous shimmer without pause.

Shimmer Effect (0ms)Shimmer Effect (1000ms)Shimmer Effect (2000ms)

Background Shimmer

Add shimmer to skeleton components and non-text elements.

shimmer shimmer-bg

Background shimmer for skeleton loaders. Apply both shimmer and shimmer-bg classes.

Skeleton Card Example

Wrap skeleton elements in shimmer-container for automatic width detection. Use --shimmer-x and --shimmer-y to coordinate timing across the diagonal sweep.

Uncoordinated

Synchronized with x/y coordinates

Color Customization

Override the shimmer highlight color with shimmer-color-{color}. Default: text color at 20% alpha.

With custom background color