Transitions and Timing
Animate between states with transitions.
Transitions and Timing is a free Angular Academy lesson on CoddyKit. This is lesson 2 of 4. Any 3 lessons of this learning path are free to read in full — after that, CoddyKit PRO unlocks every lesson, plus hands-on practice with a built-in code editor and a 24/7 AI tutor. It is part of the Angular Academy learning path, and your progress syncs across the web and the CoddyKit app. The Angular Academy course includes 4 lessons in total.
Animating Between States
States describe where the element rests; transitions describe how it moves between them. The transition function pairs a state change with an animation.
The transition Function
transition takes a state-change expression and one or more animation steps.
transition('closed => open', animate('300ms'))Direction Operators
Use => for one direction and <=> for both directions.
transition('open <=> closed', animate('250ms ease-in-out'))The animate Function
animate defines timing: duration, optional delay, and easing. The string format is "duration delay easing".
animate('500ms 100ms ease-out')Duration Units
Durations accept ms or s. A bare number is treated as milliseconds.
animate('0.4s')
animate('400ms')
animate(400)Easing Functions
Easing controls acceleration: linear, ease, ease-in, ease-out, ease-in-out, or a cubic-bezier().
animate('300ms cubic-bezier(0.25, 0.8, 0.25, 1)')Inline Target Styles
animate can take a second style argument to animate toward styles not tied to a named state.
transition('* => active', [
animate('300ms', style({ transform: 'scale(1.1)' }))
])Multiple Steps
Pass an array of steps to run a sequence within a single transition.
transition('closed => open', [
style({ opacity: 0 }),
animate('300ms', style({ opacity: 1 }))
])Wildcard Transitions
Use * to match transitions from or to any state, handy for generic enter effects.
transition('* => open', animate('200ms'))Starting Styles
A bare style() before animate() sets the starting point, then Angular animates to the destination state styles.
transition(':enter', [
style({ opacity: 0 }),
animate('400ms', style({ opacity: 1 }))
])Timing Best Practices
Keep UI transitions short (150-300ms) for responsiveness. Reserve longer durations for large, intentional motion. Match easing to the feel you want.
Quick Check
Test your understanding of transitions and timing.
Recap
You learned that transition connects state changes (with => or <=>) to animate steps. The timing string is duration delay easing, and you can chain style/animate steps for sequences.
Learn HTML with an AI tutor — free
Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.
- Courses
- 38
- Lessons
- 144
Frequently Asked Questions
Is the “Transitions and Timing” lesson free?
Yes — any 3 lessons of the Angular Academy learning path, including “Transitions and Timing”, are free to read in full here on the web. After that, CoddyKit PRO unlocks every lesson, plus interactive practice with a built-in code editor and a 24/7 AI tutor. The Angular Academy course includes 4 lessons in total.
What will I learn in “Transitions and Timing”?
Animate between states with transitions. You practise Angular Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Angular Academy?
No prior experience is required. Angular Academy on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 2 of 4.
How long does the “Transitions and Timing” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Angular Academy lesson?
Yes. Every Angular Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Animation Basics: trigger and state
- Transitions and Timing
- Enter and Leave Animations
- Keyframes and Staggering