KeyframeStrokeText
Render any text with a keyframe sequence: stroke first, fill later.
KeyframeStrokeText
Render any text with a keyframe sequence: stroke first, fill later.
Basic usage
KeyframeStrokeText
Demo will load when visible.
Chinese text demo
Chinese text
Demo will load when visible.
API
Props
| Name | Type | Default | Description |
|---|---|---|---|
text | string | '' | Text content to render |
strokeColor | string | #4C4CFF | Stroke color |
fillColor | string | #111827 | Fill color |
durationMs | number | 1800 | Animation duration (ms) |
strokeWidth | number | 2 | Stroke width |
fontSize | string | number | 64 | Font size |
fontWeight | string | number | 700 | Font weight |
fontFamily | string | inherit | Font family |
Interaction Contract
- The component renders a
role="img"SVG; non-emptytextis used as thearia-label. - Empty
textuses a non-breaking-space fallback to keep SVG measurement and layout stable, without emitting anaria-label. - Numeric
fontSizevalues are converted to px;durationMs,strokeWidth, colors, and font settings drive the animation through CSS variables. - Text metrics are synced after mount and recalculated when text, font, or stroke width inputs change.