Primitives

Spinner

A simple animated loading indicator built on the Lucide Loader2 icon, with size variants for inline use, buttons, and empty states.


Spinner Examples

Sizes

Inside a Button

In an Empty State

Loading data
Please wait while we fetch the latest results.

Installation

# The component is already installed at:
# src/components/ui/shadcn/spinner.tsx

Usage

import { Button } from '@/components/ui/shadcn/button'
import { Spinner } from '@/components/ui/shadcn/spinner'

export function SpinnerDemo() {
  return (
    <Button disabled>
      <Spinner />
      Loading...
    </Button>
  )
}

Props

PropTypeDefaultDescription
sizesm | default | lg | xldefaultControls the size of the spinner

Components

ComponentDescription
SpinnerAn animated loading icon
Previous
Sonner
Next
Switch