Skip to content

Animation ​

flint-animation: a declarative wrapper that applies Web Animations API animations to its slotted content.

  • Tag: <flint-animation>
  • Class: FlintAnimation

Import ​

ts
import '@getufy/flint-ui'; // auto-registers all
// or
import { FlintAnimation } from '@getufy/flint-ui';

Usage ​

html
<flint-animation></flint-animation>

Properties ​

PropertyAttributeTypeDefaultDescription
namenamestring'fade-in'Animation preset name (e.g., 'fade-in', 'slide-up', 'bounce') or
durationdurationnumber300Duration in milliseconds.
easingeasingstring'ease'CSS easing function.
iterationsiterationsnumber1Number of iterations. Use Infinity for infinite looping.
delaydelaynumber0Delay before the animation starts, in milliseconds.
fillfillFillMode'both'Animation fill mode.
directiondirectionPlaybackDirection'normal'Animation direction.
playplaybooleanfalseSet to true to trigger/play the animation.
playOnConnectplay-on-connectbooleanfalseWhether to play the animation automatically on first render.
keyframeskeyframesKeyframe[] | nullnullCustom keyframes. When provided, overrides the name preset.

Events ​

EventDetailDescription
flint-animation-finish—Dispatched when the animation finishes.
flint-animation-cancel—Dispatched when the animation is cancelled.

Slots ​

NameDescription
(default)Content to animate.

Methods ​

MethodDescription
cancel(): voidProgrammatically cancel the running animation.
restart(): voidRestart the animation from the beginning.