Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/docs/animations/shared/animationToValue.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
The value on which the animation will come at rest. Supported categories:

- **numbers** - number can be a either a number or a string
- **suffixed numbers** - strings being a number with a unit, like `"5.5%"`, `"90deg"` or even `"3bananas`". Just make sure there is no space between number and suffix, also suffix should consist of basic english letters only.
- **colors**
- Hexadecimal integer - e.g. `0xff1234`,
- RGB (Red, Green, Blue) - e.g. `"rgb(100, 50, 0)"`,
- RGBA (Red, Green, Blue, Alpha) - e.g. `"rgba(255, 105, 180, 0)`",
- RGB Hexadecimal - e.g. `"#53575E"`,
- HSL (Hue, Saturation, Lightness) - e.g.`"hsl(0, 50%, 50%)"`,
- Named colors - e.g. `"dodgerblue"`.
- **objects** - object with properties that will be animated separately,
- **array** - array of numbers, each value will be animated separately.
- **transformation matrix** - an array consisting of exactly 16 numerical values is by default animated as a transformation matrix. The numbers in the matrix aren't animated separately. Instead, the array gets decomposed into 3 basic transformations - rotation, scale, and translation – which are then animated separately.

Please mind, that `toValue` and the animated shared value have to share the same category (e.g. you can't animate `width` from `100px` to `50%`).
4 changes: 3 additions & 1 deletion docs/docs/animations/withSpring.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
sidebar_position: 2
---

import AnimationToValue from './shared/animationToValue.mdx';

# withSpring

`withSpring` lets you create spring-based animations.
Expand Down Expand Up @@ -59,7 +61,7 @@ enum ReduceMotion {

#### `toValue`

The value at which the animation will come to rest.
<AnimationToValue />

#### `config` <Optional />

Expand Down
4 changes: 3 additions & 1 deletion docs/docs/animations/withTiming.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
sidebar_position: 1
---

import AnimationToValue from './shared/animationToValue.mdx';

# withTiming

`withTiming` lets you create an animation based on duration and [easing](https://easings.net/).
Expand Down Expand Up @@ -53,7 +55,7 @@ enum ReduceMotion {

#### `toValue`

The value on which the animation will come at rest.
<AnimationToValue />

#### `config` <Optional />

Expand Down