Introduction
Material-UI provides several transition components to add motion to your UI. All transitions are built on top of react-transition-group.Available Transitions
Fade
Fades in from transparent.Grow
Expands outward from the center of the child element.Slide
Slides in from the edge of the screen.Zoom
Zooms in from a small scale.Collapse
Expands vertically from the top of the child element.Common Props
All transition components share these common props:in
- Type:
boolean - Default:
false
true, the component will transition in.
timeout
- Type:
number | { appear?: number, enter?: number, exit?: number } - Default: varies by component
appear
- Type:
boolean - Default:
true
in is also true.
easing
- Type:
string | { enter?: string, exit?: string } - Default: theme defaults
Component-Specific Props
Slide
direction
- Type:
'left' | 'right' | 'up' | 'down' - Default:
'down'
container
- Type:
HTMLElement | (() => HTMLElement) - Default:
undefined
Collapse
orientation
- Type:
'horizontal' | 'vertical' - Default:
'vertical'
collapsedSize
- Type:
number | string - Default:
'0px'
Grow
timeout
- Type:
number | { appear?: number, enter?: number, exit?: number } | 'auto' - Default:
'auto'
Transition Callbacks
All transitions support lifecycle callbacks:Practical Examples
Accordion with Collapse
Notification with Slide
Loading State with Fade
FAB with Zoom
Menu with Grow
Multiple Transitions
Combine multiple transitions:Accessibility
Transitions should not interfere with accessibility:Performance Tips
- Use unmountOnExit: Remove DOM elements when not visible
- Set explicit timeouts: Avoid ‘auto’ for better performance
- Memoize children: Prevent unnecessary re-renders
- Use CSS transforms: Transitions use transform and opacity for better performance
Best Practices
- Be consistent: Use the same transition types throughout your app
- Keep it subtle: Don’t overuse transitions
- Match the action: Use appropriate transitions for the UI action
- Consider motion preferences: Respect prefers-reduced-motion
- Test on slower devices: Ensure smooth animations on all devices
Comparison Guide
- Fade: Best for overlays, tooltips, and subtle appearances
- Grow: Perfect for menus, popovers, and expanding content
- Slide: Great for drawers, notifications, and directional content
- Zoom: Ideal for floating action buttons and emphasis
- Collapse: Best for accordions, expandable sections, and vertical content