Shimmer

An animated text shimmer component for creating eye-catching loading states and progressive reveal effects.

Hello, this is a shimmer effect!

Installation

pnpm dlx shadcn-svelte@latest add https://svelte-ai-elements.vercel.app/r/shimmer.json

If you prefer using jsrepo, please install via the command below:

pnpm dlx jsrepo add @ai/elements/ai-elements/shimmer

Usage

Custom Duration

Control the animation speed with the duration prop:

Custom Spread

The spread prop controls the width of the shimmer effect:

Different HTML Elements

Use the as prop to render as different HTML elements:

AI Loading State

Perfect for indicating AI processing states:

Usage with AI SDK

Use shimmer effect to indicate AI processing:

+page.svelte

Props

Shimmer

PropTypeDefaultDescription
childrenSnippet-The text content to display with shimmer effect
content_lengthnumber30The approximate length of the content for calculating shimmer spread
askeyof HTMLElementTagNameMap"p"The HTML element to render as
durationnumber2Animation duration in seconds
spreadnumber2Shimmer spread multiplier (higher = wider shimmer)
classstring-Additional CSS classes to apply
...restPropsHTMLAttributes<HTMLElement>-All other HTML element props are supported