Skip to content

Animation Utils ​

Utilities for working with CSS animations and keyframes.

AnimationWidget ​

The AnimationWidget component allows you to apply CSS keyframe animations to its children.

Usage ​

vue
<script setup>
import { defineKeyframes, Animator, AnimationWidget } from "fluekit";

// 1. Define keyframes once (globally or locally)
defineKeyframes("bounce", {
  "0%, 100%": { transform: "translateY(0)" },
  "50%": { transform: "translateY(-20px)" },
});

// 2. Create animation options
const bounceAnim = Animator({
  name: "bounce",
  duration: 1000,
  iterationCount: "infinite",
});
</script>

<template>
  <AnimationWidget :animation="bounceAnim">
    <div>Bouncing Content</div>
  </AnimationWidget>
</template>

Examples ​

Keyframe Demo ​

CSS Keyframe Animation

Bounce

Spin Animation

Spin

More Animations ​

Fade In

Fade In

Slide Up

Slide Up

Pulse

Pulse

Shake

Shake

API ​

Animation(options) ​

Helper function to create an AnimationOptions object with type checking.

defineKeyframes(name, frames) ​

Injects a @keyframes style block into the document head.

  • name: Name of the animation.
  • frames: Object where keys are selectors (e.g. '0%', 'from') and values are style objects.

AnimationWidget Props ​

PropTypeDescription
animationAnimationOptionsThe animation configuration object.

AnimationOptions ​

PropertyTypeDefaultDescription
namestring-Keyframe name
durationnumber1000Duration in ms
timingFunctionstring'ease'Easing function
delaynumber0Delay in ms
iterationCountnumber | 'infinite'1Number of iterations
directionstring'normal'Animation direction
fillModestring'none'Animation fill mode
playStatestring'running'Play state