For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
FrakmentFrakment

Shimmer

Animated gradient utility for loading text.

Generating response…

shimmer-demo.tsx
export function ShimmerDemo() {
  return (
    <p className="shimmer text-muted-foreground text-sm">
      Generating response&hellip;
    </p>
  );
}

Shimmer is a registry component (npx frakment add shimmer) that also exposes a shimmer utility class. Apply the class to any text element to animate a gradient that signals a loading or streaming state.

Installation

$ npx frakment add shimmer

Usage

tsx
<p className="shimmer">Generating response&hellip;</p>

With Marker

Thinking...
Reading 4 files
shimmer-marker.tsx
import { Marker, MarkerContent, MarkerIcon } from "@/components/ui/marker";
import { Spinner } from "@/components/ui/spinner";

export function ShimmerMarker() {
  return (
    <div className="flex w-full max-w-sm flex-col gap-4">
      <Marker role="status">
        <MarkerIcon>
          <Spinner />
        </MarkerIcon>
        <MarkerContent className="shimmer">Thinking...</MarkerContent>
      </Marker>
      <Marker role="status" variant="separator">
        <MarkerContent className="shimmer">Reading 4 files</MarkerContent>
      </Marker>
    </div>
  );
}

Color

Change the highlight color with shimmer-color-[color].

Generating response…

Generating response…

shimmer-color.tsx
export function ShimmerColor() {
  return (
    <div className="text-muted-foreground flex flex-col items-center gap-2 text-sm">
      <p className="shimmer shimmer-color-blue-500/60">
        Generating response&hellip;
      </p>
      <p
        className="shimmer"
        style={{ "--shimmer-color": "#378ADD" } as React.CSSProperties}
      >
        Generating response&hellip;
      </p>
    </div>
  );
}

Duration

Change the animation duration with shimmer-duration-[time].

Generating response…

default

Generating response…

--shimmer-duration: 1s

shimmer-duration.tsx
export function ShimmerDuration() {
  return (
    <div className="text-muted-foreground mx-auto grid w-full max-w-lg gap-6 text-center text-sm sm:grid-cols-2">
      <div className="flex flex-col gap-3">
        <p className="shimmer">Generating response&hellip;</p>
        <p className="font-mono text-xs">default</p>
      </div>
      <div className="flex flex-col gap-3">
        <p
          className="shimmer"
          style={{ "--shimmer-duration": "1s" } as React.CSSProperties}
        >
          Generating response&hellip;
        </p>
        <p className="font-mono text-xs">--shimmer-duration: 1s</p>
      </div>
    </div>
  );
}

Spread

Change the gradient spread with [--shimmer-spread:percent].

Generating response…

shimmer

Generating response…

[--shimmer-spread:40%]

shimmer-spread.tsx
export function ShimmerSpread() {
  return (
    <div className="text-muted-foreground mx-auto grid w-full max-w-lg gap-6 text-center text-sm sm:grid-cols-2">
      <div className="flex flex-col gap-3">
        <p className="shimmer">Generating response&hellip;</p>
        <p className="font-mono text-xs">shimmer</p>
      </div>
      <div className="flex flex-col gap-3">
        <p className="shimmer [--shimmer-spread:40%]">
          Generating response&hellip;
        </p>
        <p className="font-mono text-xs">[--shimmer-spread:40%]</p>
      </div>
    </div>
  );
}

Angle

Change the gradient angle with [--shimmer-angle:deg].

Generating response…

shimmer

Generating response…

[--shimmer-angle:45deg]

shimmer-angle.tsx
export function ShimmerAngle() {
  return (
    <div className="text-muted-foreground mx-auto grid w-full max-w-lg gap-6 text-center text-sm sm:grid-cols-2">
      <div className="flex flex-col gap-3">
        <p className="shimmer">Generating response&hellip;</p>
        <p className="font-mono text-xs">shimmer</p>
      </div>
      <div className="flex flex-col gap-3">
        <p className="shimmer [--shimmer-angle:45deg]">
          Generating response&hellip;
        </p>
        <p className="font-mono text-xs">[--shimmer-angle:45deg]</p>
      </div>
    </div>
  );
}

Once

shimmer-once runs the animation once.

Generating response…

shimmer-once.tsx
"use client";

import * as React from "react";

import { Button } from "@/components/ui/button";

export function ShimmerOnce() {
  const [key, setKey] = React.useState(0);

  return (
    <div className="flex flex-col items-center gap-4">
      <p
        className="shimmer text-muted-foreground shimmer-once text-sm"
        key={key}
      >
        Generating response&hellip;
      </p>
      <Button
        onClick={() => setKey((value) => value + 1)}
        size="sm"
        variant="outline"
      >
        Replay
      </Button>
    </div>
  );
}

Disable

shimmer-none disables the animation. Combine with a breakpoint for responsive control.

Generating response…

shimmer md:shimmer-none

shimmer-none.tsx
export function ShimmerNone() {
  return (
    <div className="text-muted-foreground flex flex-col items-center gap-3 text-sm">
      <p className="shimmer md:shimmer-none">Generating response&hellip;</p>
      <p className="font-mono text-xs">shimmer md:shimmer-none</p>
    </div>
  );
}

Accessibility

Shimmer is decorative. Pair it with a visible text label so the loading state is conveyed to screen readers.