BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/abui/spinner

Spinner

abui/spinner
FreeComponent

A customizable loading spinner component with size, speed, and color variants.

Live preview

live · rendered by the registry
Rendered by abui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://abui.io/r/spinner.json

Source

registry/abui/ui/spinner.tsxabui.io/r/spinner.json
1import * as React from "react"
2import { cva, type VariantProps } from "class-variance-authority"
3
4import { cn } from "@/lib/utils"
5
6const spinnerVariants = cva("animate-spin", {
7 variants: {
8 size: {
9 sm: "size-4",
10 default: "size-6",
11 lg: "size-8",
12 xl: "size-12",
13 },
14 speed: {
15 slow: "[animation-duration:1200ms]",
16 default: "[animation-duration:900ms]",
17 fast: "[animation-duration:600ms]",
18 },
19 },
20 defaultVariants: {
21 size: "default",
22 speed: "default",
23 },
24})
25
26export interface SpinnerProps
27 extends Omit<React.ComponentProps<"svg">, "size" | "speed">,
28 VariantProps<typeof spinnerVariants> {
29 /**
30 * Stroke width of the spinner arc
31 * @default 3
32 */
33 strokeWidth?: number
34 /**
35 * CSS class for the background circle
36 * @default "stroke-muted-foreground/20"
37 */
38 bgClassName?: string
39}
40
41const Spinner = React.forwardRef<SVGSVGElement, SpinnerProps>(
42 ({ className, size, speed, strokeWidth = 3, bgClassName = "stroke-muted-foreground/20", ...props }, ref) => {
43 return (
44 <svg
45 ref={ref}
46 className={cn(spinnerVariants({ size, speed }), "text-foreground", className)}
47 viewBox="0 0 42 42"
48 {...props}
49 >
50 <g fill="none" transform="translate(3 3)" strokeWidth={strokeWidth}>
51 <circle className={bgClassName} cx="18" cy="18" r="18" />
52 <path
53 className="stroke-current"
54 stroke="currentColor"
55 d="M36 18c0-9.94-8.06-18-18-18"
56 strokeLinecap="round"
57 strokeLinejoin="round"
58 />
59 </g>
60 </svg>
61 )
62 },
63)
64
65Spinner.displayName = "Spinner"
66
67export { Spinner, spinnerVariants }

What it pulls in

npm packages

  • class-variance-authority

Files it writes

  • registry/abui/ui/spinner.tsx

Facts

Registry
abui
Type
registry:component
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
2 days ago

Go to the source

Docs on abui abui.io antoniobrandao/abui on GitHub Raw registry item This item as JSON

More from abui

All 20 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordion Multiselectaccordion-multiselectabuiComponentsFree3 deps
Breakpoint Displaybreakpoint-displayabuiComponentsFreeno deps
Color Swatch Selectorcolor-swatch-selectorabuiComponentsFreeno deps
Label Selectorlabel-selectorabuiComponentsFree2 deps
Radio Rowsradio-rowsabuiComponentsFreeno deps
Radio Tabsradio-tabsabuiComponentsFreeno deps
Scroll Progressscroll-progressabuiComponentsFree1 dep
Text Gradienttext-gradientabuiComponentsFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex