Components
Spinner
An indicator that can be used to show a loading state.
Processing payment...
$100.00
Installation#
Install the dependencies
npm install cn lucide-reactCopy the source into your project
components/ui/spinner.tsximport { cn } from "cn"import { Loader2Icon } from "lucide-react"function Spinner({ className, ...props }: React.ComponentProps<"svg">) { return ( <Loader2Icon data-slot="spinner" role="status" aria-label="Loading" className={cn("size-4 animate-spin", className)} {...props} /> )}export { Spinner }Make sure the foundation is in place
Components read their colors, radius and surfaces from the tokens in
app/globals.css. See Theming.
Usage#
import { Spinner } from "@/components/ui/spinner"Examples#
Badge
SyncingUpdatingProcessing
Button
Custom
Empty
Processing your request
Please wait while we process your request. Do not refresh the page.
Input Group
Validating...