---
title: Spectrum Loader
description: A professional SVG-based loading indicator that features a vibrant, animated rainbow spectrum. By leveraging layered radial gradients and cinematic glow filters, it creates a premium visual experience. The component uses Framer Motion for high-performance spinning and stroke-draw animations, making it both smooth and highly customizable through props.
---
## Installation
CLI
Manual
```bash
npx lightswind@latest add spectrum-loader
```
Copy and paste the following code into your project.
```tsx
"use client";
import React, { useId } from "react";
import { motion } from "framer-motion";
import { cn } from "../lib/utils";
interface SpectrumLoaderProps {
size?: number;
strokeWidth?: number;
duration?: number;
colors?: string[];
glow?: boolean;
className?: string;
}
export const SpectrumLoader = ({
size = 48,
strokeWidth = 4,
duration = 2,
colors = ["#ff8000", "#00ff19", "#9900ff", "#ffff00", "#FF0000", "#00CCFF"],
glow = true,
className,
}: SpectrumLoaderProps) => {
const id = useId().replace(/:/g, "");
const maskId = `mask-${id}`;
const filterId = `glow-${id}`;
return (
);
};
export default SpectrumLoader;
```
## Usage
```tsx
import { SpectrumLoader } from "@/components/lightswind/spectrum-loader"
```
```tsx
import { SpectrumLoader } from "@/components/lightswind/spectrum-loader";
export default function App() {
return (
);
}
```