Foundations
Motion
Motion in Kanso explains what changed and where it went. It uses springs for things that move in space and short fades for everything else. It is never decoration and never in the way.
Springs and morphs, live
With reduced motion asked for, every demo here changes at once or fades instead of moving, as kanso-ui’s components do.
A pressed button tightens
A button tightens its corners and springs back. Button does it today; the FAB takes it with its family.
A toggle, selected
Either shape tightens while pressed, and a toggle trades one for the other once selected.
A button group
In a standard group a pressed button widens by 15% of its width while its neighbours narrow, so the group's width holds.
The FAB menu opens
The FAB opening a few related actions, in kanso-ui's FabMenu as it draws today.
Durations and the spring
Each track moves its dot across in one of the three durations, on the fast spring: spatial changes with a small overshoot.
short2 · 150ms · A state change on one element: hover, press, a toggle.
medium2 · 300ms · Something entering or leaving: a snackbar, a menu, a switch's thumb.
long2 · 500ms · A whole surface: a sheet, a dialog, a page change.
Durations and easing
These are custom properties in both libraries. They are not tokens in this system, which has no motion family.
| Property | Value | Use |
|---|---|---|
--kui-motion-duration-short2 | 150ms | A state change on one element: hover, press, a toggle. |
--kui-motion-duration-medium2 | 300ms | Something entering or leaving: a snackbar, a menu, a switch's thumb. |
--kui-motion-duration-long2 | 500ms | A whole surface: a sheet, a dialog, a page change. |
--kui-motion-easing-standard | cubic-bezier(0.2, 0, 0, 1) | Most movement and every fade. |
--kui-motion-easing-emphasized-decelerate | cubic-bezier(0.05, 0.7, 0.1, 1) | Things arriving. |
--kui-motion-easing-emphasized-accelerate | cubic-bezier(0.3, 0, 0.8, 0.15) | Things leaving. |
--kui-motion-easing-spring-fast | cubic-bezier(0.34, 1.56, 0.64, 1) | Spatial changes with a small overshoot: a press, the FAB, a switch, a card settling. Transform and size only. |
The scale has the steps around these too: short1 and short3 (100 and 200ms), medium1 and medium3 (250 and 350ms), long1 and long3 (450 and 600ms), and --kui-motion-easing-spring-slow.
Where Kanso moves
- Press. A button tightens its corners and springs back.
Buttondoes it today; the FAB takes it with its family. - The spotlight. When the person completes the item, the card slides out and the next item in the queue springs in.
- The now line. It moves down a day's list as time passes, without animation; the list never jumps under the person's finger.
- Sheets and dialogs. A
Sheetrises from the bottom edge on narrow windows and slides from the side on wide ones; aDialogfades and scales in. - Feedback. A
Snackbarrises and fades; nothing shakes, bounces or flashes.
Reduced motion
Under prefers-reduced-motion: reduce, every slide, scale and spring turns into a fade or an instant change, spinners slow down, and indeterminate bars stop. Nothing that carries information depends on motion. Every component in Kanso UI honours the setting; ProgressIndicator and LoadingIndicator slow down rather than stop today.