@gluonjs/core / src / TransitionGroupProps
Interface: TransitionGroupProps<Item>
Extends
Type Parameters
Item
Item
Properties
children
readonlychildren: (item,index) =>TemplateValue
Parameters
item
Item
index
number
Returns
duration?
readonlyoptionalduration?:number
Inherited from
easing?
readonlyoptionaleasing?:string
Inherited from
enter?
readonlyoptionalenter?: readonlyKeyframe[]
Inherited from
items
readonlyitems:Iterable<Item>
key
readonlykey: (item,index) =>PropertyKey
Parameters
item
Item
index
number
Returns
PropertyKey
leave?
readonlyoptionalleave?: readonlyKeyframe[]
Inherited from
reducedMotion?
readonlyoptionalreducedMotion?:boolean|"system"
Inherited from
TransitionOptions.reducedMotion
Example
Configure the iterable, stable key function, item renderer, timing, and reduced-motion policy for a transition group:
import { TransitionGroup, html, type TransitionGroupProps } from '@gluonjs/core';
type Product = { id: string; name: string };
const props = {
items: [{ id: 'lamp', name: 'Orbit Lamp' }, { id: 'tray', name: 'Stack Tray' }],
key: (product: Product) => product.id,
children: (product: Product) => html`<article>${product.name}</article>`,
duration: 180,
reducedMotion: 'system',
} satisfies TransitionGroupProps<Product>;
const animatedProducts = TransitionGroup(props);
console.log(animatedProducts);