Shimmer

Utilities for animated text highlights in loading and thinking states.

Loading preview…

Installation

Usage

These class helpers use the utilities shipped in shadcn-svelte/tailwind.css. The design system Styles already imports them. In other projects, add this once to your global CSS:

1@import "tailwindcss";
2@import "shadcn-svelte/tailwind.css";
1<script lang="ts">
2  import { shimmerClass } from "~/lib/shimmer";
3</script>
4
5<p class={`${shimmerClass} text-sm text-muted-foreground`}>Generating response…</p>
ClassEffect
shimmerRepeat a highlight across text
shimmer-oncePlay one sweep
shimmer-reverseReverse the sweep
shimmer-noneShow solid text
shimmer-color-*Set the highlight color
shimmer-duration-<ms>Set animation duration
shimmer-spread-<n>Set the band width
shimmer-angle-<deg>Set the band angle

Exports include shimmerClass, shimmerOnceClass, shimmerReverseClass, shimmerNoneClass, and the duration, spread, angle, and color class maps. The brand color helper uses Svelte orange. Write custom utilities as complete class names so Tailwind detects them.

The upstream utility follows text direction and disables motion for the user’s reduced-motion preference. Keep loading status available as readable text; shimmer is decorative.

Upstream Shimmer documentation.