Components/Stagger
Universal Component

Stagger

TransitionGroup wrapper for staggered enter and leave animations.

This page was migrated by AI, please review carefully

Migration is complete, but please validate against source code and manual review.

Stagger

TransitionGroup wrapper for staggered enter and leave animations. It applies index-based delays to each rendered child.

import { ref } from 'vue' const items = ref([ { id: 'a', text: 'Alpha' }, { id: 'b', text: 'Beta' }, { id: 'c', text: 'Gamma' }, { id: 'd', text: 'Delta' }, ]) function add() { items.value.unshift({ id: `${Date.now()}`, text: `New ${items.value.length + 1}` }) } function remove() { items.value.shift() }

Basic Usage

Stagger

Demo will load when visible.
<template>
  <TxStagger tag="div" :delay-step="30" :duration="180">
    <div v-for="item in items" :key="item.id">{{ item.text }}</div>
  </TxStagger>
</template>

API

Props

PropTypeDefaultDescription
tagstring'div'Root tag passed to TransitionGroup.
appearbooleantrueEnables the initial appear transition.
namestring'tx-stagger'TransitionGroup class name prefix.
durationnumber180Enter and leave transition duration in milliseconds.
delayStepnumber24Extra delay added per rendered child index, in milliseconds.
delayBasenumber0Base delay applied before the per-child delay, in milliseconds.
easing'ease'| 'ease-in'| 'ease-out'| 'ease-in-out'| 'linear''ease-out'CSS timing function used for opacity and transform transitions.