Loader

PreviousNext

A loading indicator component with multiple variants and status colors.

Installation

pnpm dlx shadcn@latest add loader

Usage

import * as Loader from "@/components/ui/loader"
<Loader.Root />

Examples

Variants

The loader supports four visual variants:

  • ring - Loader2Icon from Lucide with standard rotation (default)
  • spin - LoaderIcon from Lucide with slower rotation (1.5s duration)
  • dots - Three fading dots
  • bars - Three animated bars

Sizes

Control the size with the size prop: xs, sm, md (default), lg.

Status Colors

The loader supports status colors that match the badge component:

  • primary - Primary brand color (default)
  • secondary - Muted/secondary color
  • success - Success/positive state
  • warning - Warning/caution state
  • danger - Danger/error state

With Button

Use the loader with buttons to indicate loading states.