File size: 3,860 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
---
title: Transitions
description:
JSX style props for controlling an element's transition and animation.
---
## Transition
Use the `transition` prop to control the transition of an element.
```jsx
// hardcoded value
<Box bg="red.400" _hover={{ bg: "red.500" }} transition="background 0.2s ease-in-out">
Hover me
</Box>
// shortcut value
<Box bg="red.400" _hover={{ bg: "red.500" }} transition="backgrounds">
Hover me
</Box>
```
| Prop | CSS Property | Token Category |
| ------------ | ------------ | -------------- |
| `transition` | `transition` | - |
## Transition Timing Function
Use the `transitionTimingFunction` prop to control the timing function of a
transition.
```jsx
<Box
bg="red.400"
_hover={{ bg: "red.500" }}
transition="backgrounds"
transitionTimingFunction="ease-in-out"
>
Hover me
</Box>
```
| Prop | CSS Property | Token Category |
| -------------------------- | ---------------------------- | -------------- |
| `transitionTimingFunction` | `transition-timing-function` | `easings` |
## Transition Duration
Use the `transitionDuration` prop to control the duration of a transition.
```jsx
<Box
bg="red.400"
_hover={{ bg: "red.500" }}
transition="backgrounds"
transitionDuration="fast"
>
Hover me
</Box>
```
| Prop | CSS Property | Token Category |
| -------------------- | --------------------- | -------------- |
| `transitionDuration` | `transition-duration` | `durations` |
## Transition Delay
Use the `transitionDelay` prop to control the delay of a transition.
```jsx
<Box
bg="red.400"
_hover={{ bg: "red.500" }}
transition="backgrounds"
transitionDelay="fast"
>
Hover me
</Box>
```
| Prop | CSS Property | Token Category |
| ----------------- | ------------------ | -------------- |
| `transitionDelay` | `transition-delay` | `durations` |
## Animation
Use the `animation` prop to control the animation of an element.
```jsx
<Box animation="bounce" />
```
| Prop | CSS Property | Token Category |
| ----------- | ---------------- | -------------- |
| `animation` | `animation-name ` | `animations` |
## Animation Name
Use the `animationName` prop to control the name of an animation. Compose
multiple animation names to create complex animations.
:::info
The value of the `animation` prop points to a global keyframe animation. Use the
`theme.keyframes` object to define the animation.
:::
```jsx
<Box animationName="bounce, fade-in" animationDuration="fast" />
```
| Prop | CSS Property | Token Category |
| --------------- | ---------------- | -------------- |
| `animationName` | `animation-name` | `animations` |
## Animation Timing Function
Use the `animationTimingFunction` prop to control the timing function of an
animation.
```jsx
<Box animation="bounce" animationTimingFunction="ease-in-out" />
```
| Prop | CSS Property | Token Category |
| ------------------------- | --------------------------- | -------------- |
| `animationTimingFunction` | `animation-timing-function` | `easings` |
## Animation Duration
Use the `animationDuration` prop to control the duration of an animation.
```jsx
<Box animation="bounce" animationDuration="fast" />
```
| Prop | CSS Property | Token Category |
| ------------------- | -------------------- | -------------- |
| `animationDuration` | `animation-duration` | `durations` |
## Animation Delay
Use the `animationDelay` prop to control the delay of an animation.
```jsx
<Box animation="bounce" animationDelay="fast" />
```
| Prop | CSS Property | Token Category |
| ---------------- | ----------------- | -------------- |
| `animationDelay` | `animation-delay` | `durations` |
|