Skip to main navigationSkip to main content
Return to Sky UI homepage

Duration of the animation effect, used to describe CSS Transition.

Read more about creating animations with Sky UI in the Motion Guide.

import { duration } from '@sky-uk/ui-core';
duration('short-2');
// returns '200ms'

You can return the duration without a ms suffix by passing false as a second argument. This is useful if you need to use the raw number for calculations.

duration('short-2', false);
// returns 200

Available Durations

ValueDurationUsage
short-1100ms
Functional animations of small elements, best paired with linear easing.
short-2200msThis value is used for quick and smooth animation of small elements. Commonly used for Hover effects of Buttons, Checkboxes, Switches, Cards etc.
medium-1400msBest suited for medium size components and elements that require moderate motion, such as the Slide transitions in Carousels, Modals.
medium-2600msAnimations requiring a slower and more deliberate benefit from this duration. For example, Notification and Toast use this value for a slower, more controlled motion.
Foundations - Durations | Sky UI Design System