Inference Logoinference.sh

Transition

Animate layout changes for a single child component.

Preview

Wraps content that may animate during updates.

Usage

go
1node := models.WidgetNode{2    Type: models.WidgetNodeTypeTransition,3    Children: []models.WidgetNode{4        {Type: models.WidgetNodeTypeText, Value: "Animated content"},5    },6}

Props

NameTypeDescriptionDefault
type"transition"Node typerequired
childrenWidgetNodeSingle child component to animaterequired

Examples

Animated Status

go
1{2    Type: models.WidgetNodeTypeTransition,3    Children: []models.WidgetNode{4        {Type: models.WidgetNodeTypeBadge, Label: status, Variant: statusVariant},5    },6}

Animated Content Swap

go
1{2    Type: models.WidgetNodeTypeTransition,3    Children: []models.WidgetNode{4        {5            Type: models.WidgetNodeTypeCol,6            Gap:  2,7            Children: dynamicContent,8        },9    },10}

TypeScript

typescript
1const node: WidgetNode = {2  type: "transition",3  children: [4    { type: "text", value: "Animated content" },5  ],6}

When to Use

Transition is useful when:

  1. Content changes dynamically - Status updates, loading states
  2. Items appear/disappear - Lists that add/remove items
  3. Layout shifts - Content that changes size

Best Practices

  1. Wrap single logical units - One child per transition
  2. Use sparingly - Too many animations distract
  3. Consider reduced motion - Respects user preferences

we use cookies

we use cookies to ensure you get the best experience on our website. for more information on how we use cookies, please see our cookie policy.

by clicking "accept", you agree to our use of cookies.
learn more.