Skip to content
Harness Design System Harness Design System Harness Design System

Shimmer

beta

The Shimmer component creates an animated text shimmer effect, commonly used to indicate loading states or add visual emphasis to text elements in AI and chat interfaces.

Usage

With Different Duration

Control the animation speed using the duration prop (in seconds).

With Different Spread

The spread prop controls the width of the shimmer highlight effect. Higher values create a wider shimmer.

With Different Colors

Use the color prop to change the shimmer text color. Uses the same color system as the Text component.

Custom Element Type

Use the as prop to render the shimmer as a different HTML element.

Usage

import { Shimmer } from '@harnessio/ui/components'
// Basic usage
<Shimmer>Generating response...</Shimmer>
// With custom color
<Shimmer color="foreground-1">
Processing your request...
</Shimmer>
// With custom duration and spread
<Shimmer duration={3} spread={3} color="brand">
Loading...
</Shimmer>
// As a different element
<Shimmer as="h2" className="text-lg">
Loading title...
</Shimmer>

API Reference

Props

PropTypeDefaultDescription
childrenstringThe text content to display with the shimmer effect
asElementType"p"The HTML element type to render
classNamestringAdditional CSS classes to apply
durationnumber2Animation duration in seconds
spreadnumber2Multiplier for the shimmer highlight width (based on text length)
colorShimmerColor"foreground-2"Text color using the design system color tokens

Color Variants

The color prop accepts the following values:

ValueDescription
foreground-1Primary foreground color
foreground-2Secondary foreground (default)
foreground-3Tertiary foreground
foreground-4Quaternary foreground
disabledDisabled state color
successSuccess state color
warningWarning state color
dangerDanger state color
brandBrand color
mergedMerged state color