View fulldotdev/ui on GitHub

Spinner

An indicator that can be used to show a loading state.

Installation

npx shadcn@latest add @fulldev/spinner

Usage

import { Spinner } from "@/components/ui/spinner"
<Spinner />

Customization

You can replace the default spinner icon with any other icon by editing the Spinner component.

import { cn } from "cn"
import { LoaderIcon } from "lucide-react"

function Spinner({ className, ...props }: React.ComponentProps<"svg">) {
  return (
    <LoaderIcon
      role="status"
      aria-label="Loading"
      className={cn("size-4 animate-spin", className)}
      {...props}
    />
  )
}

export { Spinner }

Size

Use the size-* utility class to change the size of the spinner.

Button

Add a spinner to a button to indicate a loading state.

Badge

Add a spinner to a badge to indicate a loading state.

Input Group

Empty

RTL

To enable RTL support in shadcn/ui, see the RTL configuration guide.

API Reference

Source: react/src/components/ui/spinner.tsx