GooseUI

Components

Ripple Loader

New

Loader made of a grid of cells that light up one after another. The wave starts in the center or in any corner, the grid size is configurable, and the color comes from currentColor, so a text-* class is enough to recolor it.

Preview

Loading

Installation

npx shadcn@latest add @gooseui/ripple-loader
pnpm dlx shadcn@latest add @gooseui/ripple-loader
yarn dlx shadcn@latest add @gooseui/ripple-loader
bunx --bun shadcn@latest add @gooseui/ripple-loader

Usage

import { RippleLoader } from "@/components/ui/ripple-loader"

export default function Example() {
  return <RippleLoader size={96} gap={4} />
}

Examples

Wave origin

origin picks where the wave starts. From the center it spreads in rings, from a corner it runs along the diagonal.

Loading
center
Loading
top-left
Loading
top-right
Loading
bottom-left
Loading
bottom-right
<RippleLoader origin="center" />
<RippleLoader origin="top-left" />
<RippleLoader origin="bottom-right" />

Grid, shape and color

grid sets the cells per side, shape the cell form. The color is inherited from the text, so use any text-* class.

Loading
Loading
Loading
<RippleLoader grid={3} size={56} shape="square" gap={0} />
<RippleLoader grid={4} size={64} shape="circle" origin="top-left" className="text-foreground" />
<RippleLoader grid={5} size={72} gap={3} duration={2000} className="text-muted-foreground" />

Inside a button

At 16 px it fits next to a button label.

<Button disabled={saving}>
  {saving && (
    <RippleLoader size={16} gap={1} className="text-primary-foreground" label="Saving" />
  )}
  {saving ? "Saving" : "Save"}
</Button>

Props

PropTypeDefaultDescription
sizenumber48Width and height of the grid in px
gridnumber3Cells per side
origin"center" | "top-left" | "top-right" | "bottom-left" | "bottom-right""center"Where the wave starts
durationnumber1500One wave cycle, ms
gapnumber2Gap between cells in px
shape"square" | "rounded" | "circle""rounded"Cell shape
labelstring"Loading"Text for screen readers
classNamestring-Additional CSS classes, text-* sets the color

Features

  • Pure CSS: one keyframe and per-cell delays, no JavaScript timers
  • currentColor: inherits the text color and fits any theme
  • Accessible: role="status" with a visually hidden label
  • Reduced motion: the wave stops and the grid shows a static gradient instead