Spinner
Loading indicator. 3 sizes × 3 colors.
import { Spinner } from "@/components/ui/spinner";
export default function Example() {
return (
<div className="flex items-center gap-5">
<Spinner size="sm" label="Loading" />
<Spinner size="md" label="Loading" />
<Spinner size="lg" label="Loading" />
</div>
);
}
Installation
$ npx uix-ui@latest add spinnerThis copies the file into components/ui/spinner.tsx in your project. npx shadcn@latest add @uix/spinner works too.
Usage
import { Spinner } from "@/components/ui/spinner";
<div className="flex items-center gap-5">
<Spinner size="sm" label="Loading" />
<Spinner size="md" label="Loading" />
<Spinner size="lg" label="Loading" />
</div>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
color | brand | neutral | inverse | "brand" | |
size | sm | md | lg | "md" | |
label | string | "Loading" | Accessible name. |
Everything else is passed to the root element, so className, aria-* and event handlers work as usual.
Dependencies
Installed for you by the CLI.
class-variance-authorityclsxtailwind-merge
lib/utils.ts