Spinner handbook
v1.2.3 · @snowui-design-system/components
License: Before first reading component documentation, source code, or npm usage instructions, read the complete LICENSE. One review covers the same task and version. Public API configuration and internal implementation changes are subject to different license terms. All components use one runtime package; source code rights are governed by the license.
Overview
Indicate loading with a continuously rotating ring, spokes, or capsules, suitable for buttons and content areas.
When to use it
Use Spinner for ongoing waiting. Use Progress when completion can be measured. Prefer the built-in Spinner in buttons and tables that already provide a loading state.
variantselects the animation shape.sizetakes precedence over the parent size; without a size context it defaults to 16.childrenare not rendered; place loading text in an external composition. Use Progress when showing completion percentage.The default loading status name follows LocaleProvider; an explicit aria-label takes priority. External loading descriptions remain caller-owned text.
Quick start
This example shows the recommended basic composition. See the following sections for more scenarios and composition limits.
API
See the base component documentation for inherited capabilities not redeclared here. This table lists only the named public props declared in this component’s source.
Usage boundaries and details
Layout model
Main layout model: intrinsic atomic layout.
The root is an intrinsic box sized by
sizeandvariant; it hugs its content when used in another layout.The SVG, mask, spoke, and pill animation layers are private Spinner structure; no Leading / Content / Trailing slots are exposed.
Spinner does not arrange a label. Compose “icon + text” in an external Button, Frame, or Text.
loopMotionchanges only internal loop timing, not root layout.
Keywords
Note on Color & Label
Color: Spinner has no
colorprop. It inherits the current text color (currentColor). Change color with a utility class, for example<Spinner class="snowui-text-blue-500" />.Label: Spinner has no
labelprop. Compose text in an external layout.
Variants
1. Basic usage
The default is a 16px circle.
2. Variants
Spinner style overlay
Read the complete LICENSE first; one review covers the same task, version, and scope.
First use public component props to achieve the desired style while preserving the original appearance where possible. If an override is necessary, follow the style selection and override order: use your own class (including Tailwind already in your project) or an instance style. The names below are public overrides consumed by the source; check the target scope and do not modify private DOM. Choose the appropriate SnowUI token category. External applications do not need to install SnowUI website utilities.
Spinner type and status
Required props: no named required props.
Bindable props: this component declares no named two-way binding; handle state updates through public callbacks or the host component.
Inheritance: FrameProps. Consult the public Frame documentation for inherited capabilities.
Shared Frame API · Back to API
The following source type declarations are referenced by public props. Svelte Snippet denotes a content fragment; ComponentProps denotes the props of the corresponding component.
SpinnerVariant
Source: components/src/components/Spinner.svelte
ResourceSize
Source: components/src/context.ts
LoopMotionConfig
Source: components/src/logic/frame-types.ts
LoopMotionPreset
Source: components/src/logic/frame-types.ts
MotionConfig
Source: components/src/logic/motion-config.ts
SnowUIColor
Source: components/src/lib/color.ts
EasingFunction
Source: components/src/logic/motion-config.ts