Motion shows people what just changed: where a menu came from, that a dialog now blocks the page, that a row moved. Beehexa motion is quick and quiet, and it switches off when people ask their system to reduce motion.
How it works
- Every motion is a duration and a curve. Take both from the tokens; never type a number of milliseconds.
- Small and frequent is fast; large and rare is slower. Hover takes 100 ms, a dialog 300 ms.
- Things leave faster than they arrive. People wait for what they asked for, not for what they closed.
- Motion never carries meaning alone. A change is also shown in words, colour or position.
Duration
fastdefaultslowslowerslowestmotion.duration |
Value | Use for |
|---|---|---|
instant |
0 ms | Changes that happen at once; every duration under reduced motion |
fast |
100 ms | Hover, press, colour changes; closing tooltips, menus and toasts |
default |
200 ms | Opening tooltips, menus and toasts; tabs, switches, accordions, side navigation; closing dialogs and drawers |
slow |
300 ms | Opening dialogs and drawers |
slower |
400 ms | Opening full-screen sheets and other large surfaces |
slowest |
600 ms | Rare emphasized moments, with motion.easing.emphasized |
Curves
A curve sets how speed changes during the motion. The drawings show distance over time: a steep part is fast, a flat part is slow.
standardenterexitlinearemphasizedmotion.easing |
Use for |
|---|---|
standard |
Moving within the screen, and changes the system makes on its own |
enter |
Coming onto the screen: menus, dialogs, drawers, toasts |
exit |
Leaving the screen, one duration step shorter than the enter |
linear |
Fades of opacity or colour, progress bars, spinners |
emphasized |
Moments people see once, such as finishing onboarding. Never for everyday controls |
By component
Each kind of element has one transition token: a duration and a curve together. Use it as is; it already turns to 0 under reduced motion.
| Component | Opens | Closes | How |
|---|---|---|---|
| Hover, press, colour | motion.control |
motion.control |
Colour only (fast, standard) |
| Tab indicator, switch knob | motion.indicator |
motion.indicator |
Slides (default, enter) |
| Tooltip, menu, select, popover | motion.overlay.enter |
motion.overlay.exit |
Fades; slides motion.keyframe.offset.enter (8 px) in, .exit (4 px) out |
| Accordion, tree, side navigation | motion.expand |
motion.expand |
Expands in place (default, standard) |
| Toast | motion.overlay.enter |
motion.overlay.exit |
Fades and slides from the edge |
| Dialog | motion.modal.enter |
motion.modal.exit |
Fades and scales up from motion.keyframe.scale (95%) |
| Drawer, side panel | motion.modal.enter |
motion.modal.exit |
Slides motion.keyframe.slide, its full width |
| Full-screen sheet | motion.sheet.enter |
motion.sheet.exit |
Slides up |
| Dragged item | motion.drop |
motion.drop |
Lifted with elevation.shadow.overlay; drops or goes back on cancel |
| Rare emphasized moment | motion.emphasized |
– | Seen once, such as finishing onboarding |
Things that open and close in place, such as an accordion, take the same time both ways. Only things that leave the screen close faster.
Waiting times
- Tooltip: shows 300 ms after the pointer rests, at once on keyboard focus, and hides 100 ms after the pointer leaves. A second tooltip right after the first shows at once.
- Loading: show a spinner only when a wait passes 1 second (
motion.wait.spinner, 1000 ms). Below that people stay in flow, and a spinner that appears and vanishes reads as a flicker. Load a whole page with a skeleton. The spinner turns once a second at constant speed (motion.loop.spinner); under reduced motion it turns at half speed but never stops, because it is the only sign that work is running. - Toast: closes after 5 seconds, or 10 seconds when it has an action. The timer pauses while the pointer or focus is on it.
These waits have their own tokens: motion.wait.tooltip.show, motion.wait.tooltip.hide, motion.wait.spinner, motion.wait.toast and motion.wait.toast.action. They are waiting times, not durations, so they stay the same under reduced motion.
What does not move
- Tab content swaps at once; only the indicator slides.
- A skeleton is replaced by the content at once, without shifting the layout.
- The focus ring appears at once.
- A field error shows its message and colour at once; fields do not shake.
- Numbers change at once; they do not count up.
- Top-level pages swap at once.
Lists
Stagger items by 50 ms each and keep the whole sequence under 500 ms; items after that appear together. Close lists without a stagger. Under reduced motion there is no stagger: the whole list appears at once.
Reduced motion
When people turn on reduce motion in their system, every duration becomes 0. Menus, dialogs and toasts appear and leave at once, indicators jump, skeletons stop shimmering, lists appear in one go without a stagger, and the page jumps to an anchor instead of scrolling. How long things wait does not change: a toast stays on screen just as long.
Spinners and progress bars keep running, because they show that work is happening. They use motion.loop.spinner, which reduced motion does not set to 0, and they keep the same speed.
Beehexa components take every duration from the motion tokens, so they follow the setting without extra code. Any library a product builds on works the same way: if it has durations or animation classes of its own, map them to the motion tokens so they also become 0.
Motion started from JavaScript, such as smooth scrolling, stagger delays and chart animations, does not read the CSS tokens. Check matchMedia('(prefers-reduced-motion: reduce)') and skip the motion when it matches.
A product can also offer its own setting by adding the class bh-motion-reduced to the page; motion started from JavaScript checks the same setting. To test, turn on reduced motion in the system or the browser’s developer tools and go through the whole flow.
Moving and flashing content
- Anything that moves on its own for more than 5 seconds has a control to pause it, and pauses while the pointer or focus is on it (WCAG 2.2.2).
- Nothing flashes more than three times a second (WCAG 2.3.1).
- No parallax and no motion that sweeps across the whole screen.
Do and don’t
Close faster than you open. People wait for what arrives, not for what leaves.
A menu that takes 600 ms to close blocks the next click.
Stagger items by 50 ms, and keep the whole sequence under 500 ms.
A long stagger makes people wait for the list they asked for.
Code
Animate transform, opacity and colour only; never transition: all.
.menu {
opacity: 0;
transform: translateY(calc(-1 * var(--bh-motion-keyframe-offset-exit)));
transition:
opacity var(--bh-motion-overlay-exit),
transform var(--bh-motion-overlay-exit);
}
.menu.is-open {
opacity: 1;
transform: none;
transition:
opacity var(--bh-motion-overlay-enter),
transform var(--bh-motion-overlay-enter);
}
Use motion.duration and motion.easing directly only for motion no token above covers.
Tokens
| Token | Value | Description |
|---|---|---|
--bh-motion-duration-instant | 0ms | 0 ms. Changes that happen at once. Every duration becomes this when reduced motion is on. |
--bh-motion-duration-fast | 100ms | 100 ms. Hover, press and colour changes; closing tooltips, menus and toasts; dropping a dragged item. |
--bh-motion-duration-default | 200ms | 200 ms. Opening tooltips, menus, popovers and toasts; tab indicator, switch knob, accordion, side navigation; closing dialogs and drawers. |
--bh-motion-duration-slow | 300ms | 300 ms. Opening dialogs and drawers; closing full-screen sheets. |
--bh-motion-duration-slower | 400ms | 400 ms. Opening full-screen sheets and other large surfaces. |
--bh-motion-duration-slowest | 600ms | 600 ms. Rare emphasized moments people see once, such as finishing onboarding. Never for everyday controls. |
--bh-motion-wait-tooltip-show | 300ms | 300 ms. A tooltip shows after the pointer rests this long; at once on keyboard focus, and at once for the next tooltip. A waiting time, not a duration: it stays the same under reduced motion. |
--bh-motion-wait-tooltip-hide | 100ms | 100 ms. A tooltip hides this long after the pointer leaves. Stays the same under reduced motion. |
--bh-motion-wait-spinner | 1000ms | 1000 ms. Show a spinner only when a wait passes this long, so quick loads do not flash; under 1 second people stay in flow without a progress sign. Stays the same under reduced motion. |
--bh-motion-wait-toast | 5000ms | 5 s. A toast closes after this long. The timer pauses while the pointer or focus is on it. |
--bh-motion-wait-toast-action | 10000ms | 10 s. A toast with an action closes after this long. The timer pauses while the pointer or focus is on it. |
--bh-motion-loop-spinner | 1000ms | 1 s. One full turn of a loading spinner, at constant speed. Reduced motion does not change it: the spinner keeps turning at this speed, because it is the only sign that work is running. |
--bh-motion-easing-standard | cubic-bezier(0.4, 0, 0.2, 1) | Speeds up, then slows down. Things that move within the screen, and changes the system makes on its own. |
--bh-motion-easing-enter | cubic-bezier(0, 0, 0.2, 1) | Starts fast and slows to a stop. Things that come onto the screen: menus, dialogs, drawers, toasts. |
--bh-motion-easing-exit | cubic-bezier(0.4, 0, 1, 1) | Starts slow and speeds up. Things that leave the screen. Pair with a duration one step shorter than the enter. |
--bh-motion-easing-linear | cubic-bezier(0, 0, 1, 1) | Even speed. Fades of opacity or colour, progress bars and spinners. |
--bh-motion-easing-emphasized | cubic-bezier(0.05, 0.7, 0.1, 1) | Covers most of the distance at once, then settles slowly. Only for rare emphasized moments, with motion.duration.slowest. |
--bh-motion-keyframe-offset-enter | 0.5rem | 8 px. How far a menu, popover or toast slides as it comes in. |
--bh-motion-keyframe-offset-exit | 0.25rem | 4 px. How far it slides as it leaves. |
--bh-motion-keyframe-scale | 0.95 | Scale a dialog grows from as it opens, and shrinks to as it closes. |
--bh-motion-keyframe-slide | 100% | Drawers, side panels and full-screen sheets slide their own full width or height. |
Family tokens · Use these for a kind of element; each points to a step of the scale above.
| Token | Value | Description |
|---|---|---|
--bh-motion-control | {motion.duration.fast} {motion.easing.standard}100ms cubic-bezier(0.4, 0, 0.2, 1) | Hover, press and colour changes of buttons, fields and other controls. |
--bh-motion-indicator | {motion.duration.default} {motion.easing.enter}200ms cubic-bezier(0, 0, 0.2, 1) | Tab indicator, switch knob and other indicators that slide to a new place. |
--bh-motion-expand | {motion.duration.default} {motion.easing.standard}200ms cubic-bezier(0.4, 0, 0.2, 1) | Accordions, trees and side navigation that open and close in place. |
--bh-motion-overlay-enter | {motion.duration.default} {motion.easing.enter}200ms cubic-bezier(0, 0, 0.2, 1) | Tooltips, menus, selects, popovers and toasts coming in. Fade and slide motion.keyframe.offset.enter. |
--bh-motion-overlay-exit | {motion.duration.fast} {motion.easing.exit}100ms cubic-bezier(0.4, 0, 1, 1) | Tooltips, menus, selects, popovers and toasts leaving. Fade and slide motion.keyframe.offset.exit. |
--bh-motion-modal-enter | {motion.duration.slow} {motion.easing.enter}300ms cubic-bezier(0, 0, 0.2, 1) | Dialogs, drawers and side panels opening. Dialogs scale from motion.keyframe.scale; drawers slide motion.keyframe.slide. |
--bh-motion-modal-exit | {motion.duration.default} {motion.easing.exit}200ms cubic-bezier(0.4, 0, 1, 1) | Dialogs, drawers and side panels closing. |
--bh-motion-sheet-enter | {motion.duration.slower} {motion.easing.enter}400ms cubic-bezier(0, 0, 0.2, 1) | Full-screen sheets and other large surfaces coming in. |
--bh-motion-sheet-exit | {motion.duration.slow} {motion.easing.exit}300ms cubic-bezier(0.4, 0, 1, 1) | Full-screen sheets and other large surfaces leaving. |
--bh-motion-drop | {motion.duration.fast} {motion.easing.standard}100ms cubic-bezier(0.4, 0, 0.2, 1) | A dragged item dropping into place, or going back when the drag is cancelled. |
--bh-motion-emphasized | {motion.duration.slowest} {motion.easing.emphasized}600ms cubic-bezier(0.05, 0.7, 0.1, 1) | Rare emphasized moments people see once, such as finishing onboarding. |
Related
- Accessibility: the Beehexa rule for reduced motion.
- Elevation and Z-index: the surfaces that move.
- Interaction states: the hover and pressed colours that change.