Animation helps communicate meaning and utility in ways which delight and inform our users.
Use concise and engaging ways to direct users to the things they need without distracting or disorienting them. Guide their attention to help them complete their tasks.
Convey the relationships between elements. Educate users, showing them where they are, what they can do, and what will happen as a result of their actions.
Express the reliability of our products by using animation to create transparency, promptly validate user’s interactions, and clearly communicate what’s happening.
Implement animation that works in concert with the rest of Morningstar’s visual language, amplifying our attention to craft, clarity, and consistency.
Animation constants provide the foundational building blocks you can use to create movement and narrative within your product. All the animations within existing MDS UI components are built using these constants, and teams should use them to create the custom animations their products need.
Timing is fundamental to animation. Used properly, it helps animations feel responsive and natural. Determining which timing to use is a matter of context, including the complexity of the action and the distance over which the animation occurs.
The base increment of timing ($mds-animation-timing-1-x
) is 200ms
. This value was chosen for its speed, providing a sense of quickness which aligns with the craft and cleanliness of the rest of Morningstar’s visual language. Shorter timings are appropriate for things like hover states and other micro-interactions tied to individual components. Longer timings may be appropriate for more complex animations involving multiple elements, or motion which occurs over larger distances.
Constant Name
|
Value
|
Click Play to Preview Result
|
|
---|---|---|---|
$mds-animation-timing-half-x | 100ms |
|
|
$mds-animation-timing-1-x | 200ms |
|
|
$mds-animation-timing-1-and-a-half-x | 300ms |
|
|
$mds-animation-timing-2-x | 400ms |
|
|
$mds-animation-timing-2-and-a-half-x | 500ms |
|
|
Easing controls the velocity of an animation over its duration. It helps determine an animation’s feeling and can aid in matching the appearance of real-world physics. Easing values are plotted as curves, using the cubic-bezier CSS function.
ease-in
curves accelerate, making them good for animations where an object permanently leaves the screen, e.g., a drawer being dismissed off screen. ease-out
curves decelerate, they work well for objects which enter from off screen, e.g., a Modal coming on screen. ease-in-out
curves initially accelerate and then decelerate. They’re the default easing for animations, and work in a variety of cases, especially for objects which can move frequently, such as an item within a drag-and-drop list.
Constant Name
|
Value
|
Click Play to Preview Result
|
|
---|---|---|---|
$mds-animation-ease-in | cubic-bezier(.5,0,1,1) |
|
|
$mds-animation-ease-out | cubic-bezier(0,0,.5,1) |
|
|
$mds-animation-ease-in-out | cubic-bezier(.5,0,.5,1) |
|
|
When creating custom animations, always keep the following points in mind to help ensure the quality and usability of your implementation.
When creating custom animations, always keep the following points in mind to help ensure the quality and usability of your implementation.