Skip to content
GitHub

Spinner

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

  • Processing payment...
    $100.00
  • import {
    Item,
    ItemContent,
    ItemMedia,
    ItemTitle,
    } from "@/components/ui/pxl/item"
    import { Spinner } from "@/components/ui/pxl/spinner"
    export default function SpinnerDemo() {
    return (
    <div className="flex w-full max-w-xs flex-col gap-4 [--radius:1rem]">
    <Item variant="muted">
    <ItemMedia>
    <Spinner />
    </ItemMedia>
    <ItemContent>
    <ItemTitle className="line-clamp-1">Processing payment...</ItemTitle>
    </ItemContent>
    <ItemContent className="flex-none justify-end">
    <span className="text-sm tabular-nums">$100.00</span>
    </ItemContent>
    </Item>
    </div>
    )
    }
    pnpm dlx shadcn@latest add pxl-ui/registry/spinner
    import { Spinner } from "@/components/ui/pxl/spinner"
    <Spinner />

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

    Add a spinner to a button to indicate a loading state. Place the <Spinner /> before the label with data-icon="inline-start" for a start position, or after the label with data-icon="inline-end" for an end position.

    Add a spinner to a badge to indicate a loading state. Place the <Spinner /> before the label with data-icon="inline-start" for a start position, or after the label with data-icon="inline-end" for an end position.