Spinner

An indeterminate loading indicator that inherits the current text color.

Status: stable. Category: Feedback.

import { Spinner } from '@glyphui/ui'

Exports: Spinner, spinnerStyles.

Spinner props

PropTypeDefaultDescription
labelstringAccessible label. Omit when the spinner sits inside an element that already says it's busy.
size"sm" | "md" | "lg"

Example: Sizes

import { Spinner } from '@glyphui/ui'

export default function Example() {
  return (
    <div className="flex items-center gap-4 text-muted-foreground">
      <Spinner size="sm" />
      <Spinner size="md" />
      <Spinner size="lg" className="text-primary" />
    </div>
  )
}

Example: With a label

Pass label when the spinner is the only signal that something is loading.

import { Spinner, Text } from '@glyphui/ui'

export default function Example() {
  return (
    <div className="flex items-center gap-2 text-muted-foreground">
      <Spinner label="Syncing invoices" />
      <Text size="small" tone="muted" aria-hidden="true">
        Syncing invoices…
      </Text>
    </div>
  )
}

Live page: https://glyphui.xyz/components/spinner