Foundations

Motion

Four durations, three curves, and when to use none

import { motion } from "@nyte-ai/ui/styles/vars.stylex";

Hover a row to run it.

HandleValueUsed by
motion.durationInstant50msKbd and menu press feedback
motion.durationFast100msButtons, menus, popovers, meters
motion.durationNormal150msCollapsibles, toasts, the sidebar
motion.durationSlow200msSwitches, the sidebar
motion.easeOutease-outButtons, menus, popovers, rows
motion.easeOutQuintcubic-bezier(0.16, 1, 0.3, 1)Menus, select, the command palette
motion.easeInOutStrongcubic-bezier(0.77, 0, 0.175, 1)The switch knob

Rules

  • Transitions read a duration and a curve from motion instead of writing milliseconds.
  • Every transition has a reduced-motion path that ends in the same state without the travel.
  • Hover is an enhancement: guard it with @media (hover: hover) and (pointer: fine), and keep every action reachable by keyboard and touch.
  • CSS owns what CSS can resolve. Entry animations use @starting-style and transitionBehavior: allow-discrete, not React state and requestAnimationFrame.