For AI agents: the complete documentation index is available at https://a3s-lab.github.io/UI/v0.4.0/llms.txt, the full documentation bundle is available at https://a3s-lab.github.io/UI/v0.4.0/llms-full.txt, and this page is available as Markdown at https://a3s-lab.github.io/UI/v0.4.0/components/spinner.md.

加载指示器

实时预览

Processing payment...

用法

引入 CSS

导入 Tailwind 和一个完整的 A3S UI 样式包。

@import "tailwindcss";
@import "@a3s-lab/ui/a3s.css";

或者仅当该组件不与其他 A3S UI 组件组合时才导入 Tailwind。

@import "tailwindcss";

Spinner 是纯 HTML 加上 Tailwind 工具类,没有专用的 CSS 组件文件。

使用CDN或批量程序导入?请参见安装页。

添加加载指示器 HTML

加载指示器使用纯 HTML、loader-circle Lucide 图标和 animate-spin Tailwind 工具类。添加 role="status" 和 aria-label="加载中" 以提供无障碍状态说明。

用户启用减少动效后,完整 A3S UI 样式会停止旋转。请保留无障碍标签和相邻状态文案,让静止图标仍能清楚表达处理进度。

<svg aria-label="Loading" role="status" class="animate-spin lucide lucide-loader-circle" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-6.219-8.56" /></svg>

示例

尺寸

使用 size-* 工具类调整加载指示器的大小。

实时预览

按钮

在按钮中添加加载指示器来表达加载状态。它可以放在标签之前或之后,按钮会自动处理间距。

实时预览

徽章

在徽章中添加加载指示器来表达加载状态。它可以放在标签之前或之后,徽章会自动处理间距。

实时预览
SyncingUpdatingProcessing

输入组

实时预览

Validating...

空

实时预览

Processing your request

Please wait while we process your request. Do not refresh the page.

RTL

加载指示器的布局遵循文档方向。周围间距与方向有关时,请使用逻辑属性工具类。

实时预览

جاري معالجة الدفع...