Modifiers
animation
animation(animationObject, animatedValue)
| Parameter | Type |
|---|---|
animationObject | ChainableAnimationType |
animatedValue | number | boolean |
Returns: ModifierConfig
Works with
You can add animation to any view. It changes what you see on 39 of the 39 components.
- VStack
- HStack
- ZStack
- LazyVStack
- LazyHStack
- Group
- Spacer
- Divider
- Overlay
- ScrollView
- Button
- Toggle
- Checkbox
- Picker
- DatePicker
- ColorPicker
- Link
- ControlGroup
- Menu
- ContextMenu
- TextField
- SecureField
- Text
- Label
- Image
- List
- Form
- Section
- DisclosureGroup
- SwipeActions
- BottomSheet
- Alert
- ConfirmationDialog
- Popover
- Gauge
- TabView
- AccessoryWidgetBackground
Needs care
It works on these components, but not in the way that you may expect.
| Component | What to know |
|---|---|
| Slider | The Slider animates its own thumb. Use this for the other modifiers on the slider. |
| ProgressView | The bar animates its own progress. Use this for the other modifiers on the view. |
Sources
The original Expo docs for this page:
- animation (Modifiers) (
source-of-truth/versions/v57.0.0/sdk/ui/swift-ui/modifiers.md)