SwipeUI

Text shimmer

Token-colour text sweep with viewport/background/reduced-motion pause.

npx @swipeui/cli add text-shimmer
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

  • Status text while something works, such as "Thinking…" in an AI chat or "Generating preview".
  • Loading labels where a spinner feels too heavy.
  • Drawing gentle attention to a waiting state.

When not to use it

  • Text people need to read carefully.
  • Long-running loads with known progress. Use Progress.
  • Permanent labels.

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 text-shimmer
  • Adds components/swipeui/ui/text-shimmer.tsx and 3 shared helpers.
  • Installs react-native-reanimated, uniwind, react-native-worklets. In Expo apps it uses npx expo install so versions match your SDK.

Usage

app/loading.tsx
import { TextShimmer } from '@/components/swipeui/ui/text-shimmer';

<TextShimmer text="Preparing your workspace" />;

Examples

status uses a semibold Thinking label close to its drawn assistant mark. colors uses bold title text and a wider primary-to-info colour sweep. The app and website share content, named boards and compact outside controls. The colors board also offers finite Cycles so you can inspect its resting colour.

Settings

SettingDefaultBehavior
textrequiredComplete visible and spoken status.
activetrueExplicit pause; offscreen and background pauses are automatic.
speed1Positive finite playback rate.
direction'forward''reverse' sweeps from the end to the start.
cycles-1Positive whole sweep count, or -1 to loop. A completed sweep leaves every glyph on baseColor.
baseColormuted foreground tokenResting colour.
highlightColorforeground tokenSweep colour.
spread2Positive finite half-width in glyphs.
motionapp feelShared ambient feel; Reduce Motion holds plain text.
classNameabsentRoot classes.
textClassName'text-body'Text style classes.
styleabsentNative layout escape hatch.
testIDabsentRoot ID.

Accessibility

The complete text is one accessible label; animated copies are hidden. Shaped scripts stay whole. Reduce Motion preserves the meaning. Native screen-reader, Dynamic Type and performance checks remain pending at 7.9.

Behavior and gestures

  • Add speed, reverse direction, finite cycles, independent ink colours and spread; validate playback inputs. Real assistant and workspace boards replace active/paused.
  • The application owns its content; demo controls sit outside the item.

Accessibility

  • The status is read once as one label.
  • Reduce Motion stops the sweep and shows plain text.
  • Colour comes from your tokens, so contrast holds.

Motion

  • Uses the ambient motion role, so it follows your app's feel. Pass motion to tune this one instance.
  • Add speed, reverse direction, finite cycles, independent ink colours and spread; validate playback inputs. Real assistant and workspace boards replace active/paused.
  • Native runtime evidence remains pending at 7.9.

Performance

  • Pauses automatically when not visible.

Notes for AI

  • Set active={false} when the work finishes or the screen loses focus.

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