Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Overlays

  • Dialog
  • Modal
  • AlertDialog
  • Drawer
  • Popover
  • Tooltip
  • HoverCard
  • Glimpse
  • HeroVideoDialog
  • ElementSelectionOverlay

Messages

  • Alert
  • InterceptCard
  • Callout
  • Banner
  • Toast
  • Notification
  • ServiceMessage
  • Result
  • GiftFeed
  • FloatingReactions
  • Popconfirm

Loading and Progress

  • Spin
  • Spinner
  • Progress

Guidance

  • Tour

Spinner

spinner

Renders a standalone CSS loading ring with status semantics.

Usage

Basic usage

Default md size, primary color rotation indicator, pure CSS animation, can be RSC.

tsx
<Spinner />

Three sizes

size Control size: sm / md / lg.

tsx
<>
  <Spinner size="sm" />
  <Spinner size="md" />
  <Spinner size="lg" />
</>

Hue

tone switches the semantic color, current follows the parent text color, and can be placed in dark buttons.

tsx
<>
  <Spinner tone="primary" />
  <Spinner tone="muted" />
  <span className="text-danger"><Spinner tone="current" /></span>
</>

When to use

Use Spinner as a bare loading icon inside a button, inline status, or empty region. It is a CSS-animated SVG ring with role=status and no interaction. Use Spin for overlays or fullscreen loading, and Progress for known progress.

Import

ts
import { Spinner, spinnerVariants } from "@hulianui/ui"

Props

NameTypeDefaultDescription
size"sm"|"md"|"lg""md"Spinner size.
tone"primary"|"current"|"muted""primary"Color. current inherits currentColor for colored controls.
labelstringFrom ConfigProviderScreen-reader status copy. Explicit values take precedence over the locale.
classNamestring-Container class name.

Example

tsx
<Spinner />

<Button>
  <Spinner size="sm" tone="current" />
  Submitting
</Button>

Usage guidelines

  • Use tone="current" to inherit a button or link's foreground. The default primary tone is fixed.
  • Spinner has no spinning switch: rendering it means spinning. Conditionally render it or use Spin's spinning prop.
  • No other known caveats.

Related

Spin · Progress · Dialog · Modal · AlertDialog · Drawer

Playground

<Spinner />
PreviousSpinFeedbackNextProgress

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Example
    • Usage guidelines
    • Related
  • Playground