SwipeUI

Spinner

Continuous fading comet with constant rotation and configurable speed.

npx @swipeui/cli add spinner
Variant
Preset
Material
Scheme
Feel
Real free component with a browser animation bridge. Native motion, haptics and materials need a device.

When to use it

  • Short waits with no known progress, such as loading a screen or refreshing.
  • Inline loading next to a label, like "Saving…".
  • Full-screen loading with the large size.

When not to use it

  • Known progress. Use Progress.
  • Content placeholders. Use Skeleton.
  • Button loading; Button has its own.

Installation

Run this from your app's root. If SwipeUI isn't set up yet, run npx @swipeui/cli init first; it sets up Uniwind, the theme tokens and the cn helper.

npx @swipeui/cli add spinner
  • Adds components/swipeui/ui/spinner.tsx and 4 shared helpers.
  • Installs uniwind, react-native-svg, react-native-reanimated, react-native-worklets, clsx, tailwind-merge, class-variance-authority. In Expo apps it uses npx expo install so versions match your SDK.

Usage

app/search.tsx
import { Spinner } from '@/components/swipeui/ui/spinner';

<Spinner label="Loading results" />;

Examples

Use the variant and appearance controls in the live specimen to compare the documented states. The application owns validation, operation results and persistence.

API reference

SpinnerProps

PropTypeDefaultDescription
variant?"arc" | "comet" | "native"'comet'

Continuous fading comet, or explicit platform activity. arc is a compatibility alias.

speed?0.5 | 1 | 21

Rotation speed multiplier.

diameter?number20, 24 or 36, from size

Comet diameter override in points.

color?stringprimary token

Theme colour override.

label?string'Loading'

Named operation.

size?"large" | "medium" | "small"'small'

Comet size; native maps medium to its small activity indicator.

active?booleantrue

Show the activity state.

motion?MotionOverride—

Reduce Motion displays a static status instead of continuous rotation.

className?string—

Root classes.

style?StyleProp<ViewStyle>—

Native layout escape hatch.

testID?string—

Root ID.

Native view/input props not listed here pass through where the exported TypeScript type allows them.

Composition and behavior

  • label names the work; size is small, medium or large; active shows or hides it.

Feedback lineup settings

PropDoes / default
variantContinuous comet or explicit platform activity. @default 'comet'
diameterComet diameter override in points. @default 20, 24 or 36 from size
colorTheme colour override. @default primary token
labelNamed operation. @default 'Loading'
sizeComet size; native maps medium to small. @default 'small'
activeShow the activity state. @default true
motionReduce Motion displays a static status instead of continuous rotation.
classNameRoot classes.
styleNative layout escape hatch.
testIDRoot ID.

The default is the trackless comet (variant="comet"), rendered as one slightly thicker continuous stroke with a tail fading to zero at every size. Rotation is linear through each revolution. speed accepts 0.5, 1 (default) or 2; switching speeds preserves full revolutions. variant="native" remains available for existing callers. The Sizes board combines all three sizes; Colors compares three semantic colours. Both expose speeds. variant="arc" remains a compatibility alias for comet. Hidden/background animation pauses; Reduce Motion shows the named static status.

Behavior and gestures

  • Static; it spins while active and disappears when active is false.

Accessibility

  • Announced as a busy progress indicator with its label, such as "Loading messages".
  • Under Reduce Motion it shows the label with an ellipsis instead of spinning.
  • Colour comes from your theme tokens.

Motion

  • Uses the ambient motion role, so it follows your app's feel. Pass motion to tune this one instance.
  • One continuous SVG comet rotates at constant angular velocity; speed scales its token duration.
  • Reduce Motion replaces it with static text.

Performance

  • UI-thread rotation; pauses offscreen, in background and under reduced motion.

Notes for AI

  • Give a specific label, such as "Loading orders".

Compatibility

Runs onSupported
Expo SDK 57Yes
Expo SDK 58Yes
React Native CLI (with Expo modules)Yes
Expo GoYes
iOSYes
AndroidYes

This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.

Related items