View fulldotdev/ui on GitHub

Spinner

An animated loading indicator.

Installation

npx shadcn@latest add @fulldev/spinner

Usage

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

Spinner renders the Lucide loader-circle icon with role="status" and aria-label="Loading". Next to visible loading text, the text can carry the main status message.

Customization

Replace the default icon by editing spinner.astro.

---
import type { HTMLAttributes } from "astro/types"
import LoaderIcon from "@lucide/astro/icons/loader"

import { cn } from "@/lib/utils"

type Props = HTMLAttributes<"svg">

const { class: className, ...props } = Astro.props
---

<LoaderIcon
  data-slot="spinner"
  role="status"
  aria-label="Loading"
  class={cn("size-4 animate-spin", className)}
  {...props}
/>

Size

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

Button

Place the Spinner before the label with data-icon="inline-start", or after it with data-icon="inline-end".

Badge

Place the Spinner before the label with data-icon="inline-start", or after it with data-icon="inline-end".

Input Group

Empty

RTL

Set dir="rtl" on a parent element.

API Reference

Source: src/components/ui/spinner

Spinner accepts all SVG attributes plus the Lucide icon props color, size, stroke-width and absoluteStrokeWidth.