For AI agents: the complete documentation index is available at https://rickyshin93.github.io/tao-ui/zh/llms.txt, the full documentation bundle is available at https://rickyshin93.github.io/tao-ui/zh/llms-full.txt, and this page is available as Markdown at https://rickyshin93.github.io/tao-ui/zh/components/spinner.md.
v0.0.57
  • 简体中文
  • Spinner

    反馈@rockshin/tao-ui

    展示局部、内容覆盖或全屏加载状态。

    何时使用

    系统正在等待且无法立即展示最终内容时使用 Spinner。

    推荐

    • 快速操作使用 delay 避免闪烁。
    • 较长等待提供说明文字。

    避免

    • 不要用 Spinner 掩盖没有结束条件的流程。

    代码演示

    基础用法

    Loading
    TSX

    提示与自定义指示器

    Loading data◌CustomPreparing preview
    TSX

    内容覆盖与延迟

    Content remains mounted below the overlay.
    TSX

    内容加载遮罩

    spinning 控制内容区域的加载状态。

    Card title

    Content stays in place and dims while the spinner overlays it.

    Loading
    TSX

    延迟显示加载

    短暂请求可在 delay 之前结束,减少闪烁。

    500ms delay — quick toggles won't flash the spinner.

    Toggle quickly to see the delay in action.
    TSX

    自定义加载图标

    indicator 替换视觉图标,仍需提供清晰的状态文字。

    ⏳Please wait
    TSX

    受控加载状态

    用外部状态控制 spinning,内容保留在原位置。

    Your workspace content stays here.
    TSX

    API

    Spinner

    属性说明类型默认值
    spinningWhether the spinner is visible. Defaults to true.boolean | undefinedtrue
    sizeSize of the indicator. Inherits from TaoProvider.TaoSize | undefined-
    tipDescription text rendered under the indicator.ReactNode-
    delayDelay (ms) before showing the spinner — prevents flicker on fast loads.number | undefined-
    indicatorCustom indicator node, replaces the default spinner.ReactNode-
    childrenWrap content: the spinner overlays children while spinning.ReactNode-
    fullscreenRender a full-screen backdrop with a centered spinner.boolean | undefined-
    className节点类名string | undefined-
    style节点样式CSSProperties | undefined-