Preview
Spinner Loaders
Small
Medium
Large
Dots Loaders
Small
Medium
Large
Pulse Loaders
Small
Medium
Large
Bars Loaders
Small
Medium
Large
Color Variants
Primary
Secondary
Preset Examples
Small Spinner
Medium Dots
Large Pulse
Installation
<> import.ts
import { Loader } from "@/components/ui/loader"Code
<> component.tsx
import { Loader } from "@/components/ui/loader"
<Loader />API Reference
Loader
A loading component with various animation styles.
<> import.ts
import { Loader, LoaderPresets } from "@/components/ui/loader"Props
| Prop | Type | Default | Description |
|---|---|---|---|
size | "sm" | "md" | "lg" | "md" | Size of the loader |
variant | "spinner" | "dots" | "pulse" | "bars" | "outline" | "spinner" | Animation variant of the loader |
color | "primary" | "secondary" | "accent" | "primary" | Color theme of the loader |
className | string | "" | Additional CSS classes |
Examples
Example 1
<> example.tsx
// Basic loader
<Loader />Example 2
<> example.tsx
// Different variants
<Loader variant="spinner" />
<Loader variant="dots" />
<Loader variant="pulse" />
<Loader variant="bars" />
<Loader variant="outline" />Example 3
<> example.tsx
// Different sizes
<Loader size="sm" />
<Loader size="md" />
<Loader size="lg" />Example 4
<> example.tsx
// Different colors
<Loader color="primary" />
<Loader color="secondary" />
<Loader color="accent" />Example 5
<> example.tsx
// Custom loader
<Loader
variant="outline"
size="lg"
color="accent"
/>Presets
smallSpinnerSmall spinner loader with primary color
mediumDotsMedium dots loader with primary color
largePulseLarge pulse loader with primary color
accentBarsMedium bars loader with accent color
outlineLoaderMedium outline loader with primary color