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

Spin

spin

Overlays a loading indicator on existing content while preserving its layout.

Usage

Package contents

When spinning is used, the wrapped content is covered with a translucent mask + a centered indicator, making the content transparent and non-interactive.

Monthly Report

Data is being calculated, please wait. Here is the content area covered by the mask.

Loading...
tsx
<Spin spinning tip="Loading...">
  <YourContent />
</Spin>

Loading completed (directly out of content)

When spinning=false, the mask is not rendered, and children is displayed normally.

Monthly Report

Data is being calculated, please wait. Here is the content area covered by the mask.

tsx
<Spin spinning={false}>
  <YourContent />
</Spin>

Pure indicator

When children is not transmitted, Spin acts as an independent loading indicator (without mask) and can have prompt copy.

Processing
tsx
<Spin spinning tip="Processing" />

Three sizes

size is passed to the internal Spinner and controls the indicator size.

tsx
<>
  <Spin spinning size="sm" />
  <Spin spinning size="md" />
  <Spin spinning size="lg" />
</>

When to use

Use Spin to cover a region while a table or card refreshes, blocking pointer interaction with a translucent overlay, spinner, and optional message. Use Spinner for a bare inline loading icon or Progress when completion is measurable.

Import

ts
import { Spin } from "@hulianui/ui"

Props

NameTypeDefaultDescription
spinningbooleantrueWhether loading is active.
delaynumber0Milliseconds loading must persist before the overlay appears.
size"sm"|"md"|"lg""md"Size forwarded to the internal Spinner.
fullscreenbooleanfalseUses a fixed viewport overlay and ignores children.
classNamestring-Container class name.

Slots

SlotTypeDescription
tipReactNodeLoading copy centered below the Spinner.
childrenReactNodeCovered content; without it, Spin becomes a standalone indicator.

Example

tsx
<Spin spinning={loading} tip="Loading…"><ReportTable /></Spin>

{busy && <Spin fullscreen tip="Loading…" />}

Usage guidelines

  • fullscreen ignores children and covers the viewport; fullscreen and wrapped-content use are mutually exclusive.
  • Use delay to prevent a flash for fast requests. Use zero for work that should report loading immediately.
  • Without children, Spin is effectively a Spinner with a tip.
  • No other known caveats.

Related

Spinner · Progress · Dialog · Modal · AlertDialog · Drawer

Playground

Monthly Report

Data is being calculated, please wait. Here is the content area covered by the mask.

Loading...
<Spin spinning={true} size="md" tip="Loading..." delay={0}>
  {children}
</Spin>
PreviousPopconfirmFeedbackNextSpinner

On this page

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