SlotText handbook
v1.11.2 · @snowui-design-system/components
License: Before reading component documentation, source, or npm usage instructions for the first time, read the full LICENSE. Reuse that review for the same task and version. Public API configuration and internal implementation changes have different license implications. All components use the unified runtime package; source rights remain governed by the license.
Overview
Show text changes with a vertical roll for each character, suitable for short headings, statuses, counts, and time displays.
When to use it
Use it for slot-style text replacement. Use Text for static copy; NumberFlow or NumericText for number-specific rolling.
textupdates content,replayKeyreplays identical content, andplayOnMountcontrols the initial animation.animated={false}shows content immediately. EnablerespectMotionPreferenceto honor the system reduced-motion setting.
Quick start
This example shows the recommended basic composition. See the sections below for more cases and composition limits.
API
See the base component documentation for inherited capabilities not redeclared here. This table lists only named public Props declared by this component.
Usage boundaries and details
Keyword
All six typography defaults inherit from the parent. On update, motionColor colors the full target text, then characters return from left to right to color or the inherited color after the main duration and each character delay. The color’s main timing remains duration + exitOffset; its return timing remains colorFade. Numeric movement still starts from least to most significant digit. These two timelines do not alter each other’s direction.
Numeric content follows the shared trend protocol. Trend compares only old and new result values: -3 -> -2 increases and -2 -> -3 decreases. Multiplication and division use the larger or smaller result, not the operator, to choose Up or Down. Complete time strings use circular base-60 differences for mm:ss or HH:mm:ss: 59:59 -> 00:00 is an increasing timer and 00:00 -> 59:59 is a decreasing countdown. A single 00..59 segment also uses base-60 units when motionRole="timer" or "countdown". With direction="normal", text exits upward and enters from below, increasing numbers and timers move up, and decreasing numbers and countdowns move down. direction="reverse" flips all of these rules. Changed digits start from least to most significant, visually right to left. trend={1|-1} overrides automatic inference but is still flipped by reverse.
SlotText style overrides
Read the full LICENSE first; reuse that review for the same task, version, and scope.
First use public component Props to match the desired appearance, preserving the existing look where possible. If changes are necessary, follow the style selection and override order: use your own class (including Tailwind already in the project) or an instance style. The names below are public overrides actually consumed by source; check their scope and do not modify private DOM. Choose the correct SnowUI token family. External apps need not install SnowUI website utilities.
This component source does not directly consume a registered component-specific override. Style composed children through public parts or an explicit child; do not guess variable names.
SlotText types and states
Required Props: no named required Props.
Bindable Props: this component declares no named two-way binding; handle state updates through public callbacks or its host.
Inheritance: Omit<FrameProps, "children">. Consult the base class public documentation; fields excluded by Omit cannot be passed through unchanged.
Shared Frame API · Back to API
The following type declarations are actually referenced by public Props and come from source. A Svelte Snippet denotes a content fragment; ComponentProps denotes the Props of the corresponding component.
SlotTextDirection
Source: components/src/components/SlotText.svelte
SlotTextTrend
Source: components/src/components/SlotText.svelte
TextMotionTrend
Source: components/src/lib/text-motion/types.ts
TextMotionRole
Source: components/src/lib/text-motion/types.ts
SlotTextTransition
Source: components/src/components/SlotText.svelte
SnowUIColor
Source: components/src/lib/color.ts
TextMotionAlign
Source: components/src/lib/text-motion/types.ts
TextMotionColor
Source: components/src/lib/text-motion/types.ts
TextMotionColorResolver
Source: components/src/lib/text-motion/types.ts