Skip to content
Primer printing platePrimer

Icon motion

An icon can acknowledge an action or a change of destination with a short, authored animation. Keep a visible label, treat the artwork as decorative, and return to a stable resting image. Hover and focus do not play an animation. Repeated activation restarts it. Reduced motion blocks playback and stops a running animation at rest.

The live specimens include a Fable reference and a separate six-icon gallery. These are private catalog demonstrations; applications own their implementation and dependencies.

This reference follows Tally/Fable revision 466f02c. Fable bundles Lottie JSON artwork and renders it with the lightweight SVG Lottie player. References to “native timelines” in older guidance mean application-bundled artwork, not a separate native animation renderer.

Fable has two paths:

Decision Fixed navigation Library-backed object and custom icons
Component AnimatedSidebarIcon AnimatedCustomSidebarIcon
Choose artwork Sidebar destination maps to one of 13 named timelines Saved icon ID maps to a timeline name; unmapped IDs retain the static object glyph
Load Timelines are statically imported; the player is loaded lazily Each timeline is imported lazily in parallel with the player
Play Frame zero through the full timeline, once Frame zero through the authored rest marker, once
Rest Last frame: duration in frames minus one Frame specified by the rest marker

The fixed set is analytics, archive, bookmark, calendar, clock, list, logout, notes, refresh, settings, tools, trash and user. The object/custom library has more than 100 timelines. The six curated gallery icons are a small selection of that artwork, not a count of Fable’s supported animations.

  1. Resolve the icon. Fixed navigation uses a named timeline. Object types use the selected icon ID; for example, file-text resolves to document, and hugeicons:star resolves to star. An unmapped ID stays a static glyph.
  2. Load with a fallback. Keep the static icon visible while the player and, for custom icons, the timeline load. Each player receives its own animation data. The custom loader supplies missing zero mask expansion and converts single-keyframe tracks to constants for Lottie compatibility without replacing the authored motion.
  3. Render the resting frame. Rendering and initial selection do not autoplay. An initially active item rests until a later activation.
  4. Play on activation. Both components listen for clicks on the containing control and for an inactive-to-active transition. Native buttons supply pointer, touch, Enter and Space activation; links follow native link keyboard behavior. Hover and focus do not play. Click and active-state effects are independent in Fable’s source; this reference does not promise deduplication when one interaction invokes both.
  5. Finish or stop at rest. Repeated activation restarts playback. Reduced-motion preference changes clear pending playback and stop at rest. Turning reduced motion off does not resume an earlier action. Missing or failed custom animations keep the static glyph; a failed player import also retains the fallback.
  6. Clean up. Icon replacement and unmounting detach listeners, discard pending work and destroy the player. A late asynchronous load must not attach to an old icon.

Animation acknowledges the action; it does not own routing, saved icon IDs, selected state, accessible names or application persistence. Those stay in Fable.

Every link below is pinned to the inspected revision:

Responsibility Owning source
Destination mapping and active state Application sidebar
Fixed navigation playback AnimatedSidebarIcon
Saved icon ID to timeline name Library icon mapping
Object/custom playback and static fallback AnimatedCustomSidebarIcon
Per-timeline loading and compatibility normalization Library loader
Artwork provenance and timing markers Library manifest, library notice, fixed-navigation notice

These are source-verified behaviors, not a claim of installed-device or assistive-technology acceptance.

In the Fable reference, each path starts with one selected item resting. Choose another icon to select and play it, then choose it again to replay. Change Active item to inspect a state transition without clicking the icon. Preview reduced motion stops playback and blocks later play requests; the system preference always takes precedence.

The visible state reads Loading, Playing, Resting or Static fallback. The static example illustrates an unavailable animation. A failed timeline request also keeps its resting artwork visible. State labels do not announce every animation frame to assistive technology.

The demo uses exact calendar/settings navigation timelines and document/star library timelines from the pinned Fable source. Its resting SVG previews stand in for Fable’s own static fallback glyphs. The dropdown, replay labels, reduced-motion checkbox and single playback request for a combined click/selection are catalog inspection controls, not Fable UI or a reproduction of its React scheduling. The demo’s shared player uses an explicit endpoint for fixed timelines and the authored resting marker for library timelines.

For a Fable change, update the owning application first:

  • Fixed navigation: add the timeline import and named entry in animated-sidebar-icon.tsx, then map the destination in app-sidebar.tsx. Confirm the full animation ends at the intended resting image.
  • Object/custom icons: add the timeline under packages/icons/src/animations/library/, its lazy import in library-animation-loader.ts, and the saved icon-ID mapping in packages/types/src/library-icon-animations.ts. Retain a valid authored rest marker, provenance, license and manifest entry. Keep the static glyph usable for unmapped IDs and loading failures.

To refresh this Primer reference:

  1. Select an immutable Fable revision and inspect both components, the mapping and the loader. Update this guide’s source links and any changed behavior together.
  2. Copy representative JSON bytes and render matching resting previews. Record the source path, revision, SHA-256, rest frame and playback endpoint in catalog/src/assets/icon-motion/fable/manifest.json; preserve the source notices. Reuse existing identical library assets rather than duplicating them. Update the catalog component when its sample names or frame numbers change.
  3. Run node --test tests/icon-motion.test.mjs and npm run docs:build. In the catalog preview, check initial rest, click, active-state transition, repeat, keyboard, delayed or failed loading, live reduced-motion changes, and narrow layouts in both appearances.

Primer does not import Fable’s source checkout or expose the catalog player as a supported component API.

The six gallery timelines are LottieFiles Generative Icons (MIT), pinned to upstream commit 1cc0ad00af2cad7ca109cbafa621a7693f0654f7. Source files, resting previews, licenses and a hash manifest are in catalog/src/assets/icon-motion/. Source and local hashes are recorded separately. Each preview is a separate SVG document to isolate mask IDs.

The catalog’s private player loads only on the motion page, parses fresh JSON per instance, supplies missing zero mask expansion and converts animated single-keyframe tracks to constants. It preserves authored paths, masks and easing, keeps the static fallback until the rest frame renders and retains it on failure. It uses lottie-web 5.13.0; the MIT player notice is retained beside the artwork notice. The fixed-navigation source notice is retained separately; the library’s MIT license is not attributed to the fixed artwork.