Components/TuffLogoStroke

TuffLogoStroke

An animated SVG stroke of the Tuff logo.

VerifiedSince 0.3.4

Usage

Animation Modes

once draws the logo in once on mount; breathe keeps a subtle pulse after the draw-in; hover waits for a hover.

Loading demo...

Palette and Duration

Loading demo...

Best Practices

  • Use once for splash, loading-complete, or first-view brand moments.
  • Use hover when the logo sits near an interactive affordance and shouldn't keep drawing attention.
  • Use breathe sparingly; repeating brand motion competes with primary UI feedback.
  • Keep custom colors close to the surrounding surface; high-saturation gradients suit calm backgrounds.
  • Don't wrap the SVG in another animation unless you've checked the combined reduced-motion behavior.

API Reference

Props

PropTypeDefaultDescription
sizestring | number120SVG width and height; numbers become px.
mode'once' | 'breathe' | 'hover' | 'loop''once'Animation trigger; loop behaves as breathe.
durationMsnumber2200Base animation duration in ms.
strokeColorstring'#4C4CFF'Outline stroke color.
fillStartColorstring'#199FFE'Start color of the core fill gradient.
fillEndColorstring'#810DC6'End color of the core fill gradient.
outerStartColorstring'#D73E4D'Start color of the outer radial gradient.
outerEndColorstring'#7F007F'End color of the outer radial gradient.

Overview

  • It renders one SVG with role="img" and the accessible name Tuff logo stroke animation.
  • mode="loop" is an alias of breathe kept for older call sites; both produce the same state class, so write breathe in new code.
  • Gradient and filter ids are generated per instance with useId(), so logos on one page never collide; snapshot tests should assert unique ids, not exact strings.
  • durationMs is written to --tx-tuff-logo-duration, and the breathe pulse derives from it.
  • Under reduced motion, nothing animates and the fully drawn state shows.

Technologies

  • Source: packages/tuffex/packages/components/src/tuff-logo-stroke/.
查看源码
packages/tuffex/packages/components/src/tuff-logo-stroke/index.ts