Animation duration
A 180ms dropdown feels more responsive than a 400ms one, even when nothing else changes. Each kind of element gets a ceiling: press feedback, tooltips, menus, toasts and modals.
12345{ "rules": { "systomic/animation-duration": "warn" }}See the difference
className="duration-[400ms]"className="duration-200"What doesn't work
Oxlint
5 findings12345678910111213141516171819202122232425import * as stylex from "@stylexjs/stylex";import { motion } from "motion/react";import { DropdownMenu, Tooltip } from "radix-ui";
const styles = stylex.create({ card: { transition: "opacity 400ms ease-out", },});
export function Toolbar() { return ( <> <button className="transition-transform duration-300 active:scale-95">Save</button> <DropdownMenu.Root> <DropdownMenu.Content className="transition-opacity duration-[400ms]" /> </DropdownMenu.Root> <Tooltip.Root> <Tooltip.Content className="transition-opacity duration-300" /> </Tooltip.Root> <div {...stylex.props(styles.card)} /> <motion.div animate={{ opacity: 1 }} transition={{ duration: 0.6 }} /> </> );}systomic/animation-duration transition: "opacity 400ms ease-out" is 400ms. UI animations stay at or under 300ms: shorter animations feel more responsive.
systomic/animation-duration duration-300 is 300ms. Press feedback stay at or under 160ms: shorter animations feel more responsive.
systomic/animation-duration duration-[400ms] is 400ms. Dropdowns, selects and menus stay at or under 250ms: shorter animations feel more responsive.
systomic/animation-duration duration-300 is 300ms. Tooltips stay at or under 200ms: shorter animations feel more responsive.
systomic/animation-duration duration: 0.6 is 600ms. UI animations stay at or under 300ms: shorter animations feel more responsive.
Stylelint
2 findings123456.card { transition: transform 400ms ease-out;}.tooltip { transition-duration: 250ms;}systomic/animation-duration transition: transform 400ms ease-out is 400ms. UI animations stay at or under 300ms: shorter animations feel more responsive.
systomic/animation-duration transition-duration: 250ms is 250ms. Tooltips stay at or under 200ms: shorter animations feel more responsive.
What works
No findingsOxlint
123456789101112131415161718192021import { motion } from "motion/react";import { Dialog, DropdownMenu } from "radix-ui";
export function Toolbar() { return ( <> <button className="transition-transform duration-150 active:scale-95">Save</button> <DropdownMenu.Root> <DropdownMenu.Content className="transition-opacity duration-200" /> </DropdownMenu.Root> {/* Modals and drawers may take up to 500ms. */} <Dialog.Root> <Dialog.Content className="transition-transform duration-500" /> </Dialog.Root> {/* Loops are a cycle, not a UI transition. */} <div className="animate-spin duration-1000" /> <motion.div animate={{ rotate: 360 }} transition={{ duration: 1, repeat: Infinity }} /> <motion.div animate={{ opacity: 1 }} transition={{ duration: 0.2 }} /> </> );}Stylelint
123456789.card { transition: transform 200ms ease-out, opacity 150ms ease 600ms;}.drawer { animation: slide-in 450ms ease-out;}.spinner { animation: spin 1s linear infinite;}Details
UI animations stay short. A 180ms dropdown feels more responsive than a 400ms one, and a faster spinner makes the app feel like it loads faster, even when the load time is the same. Modals, drawers, sheets and toasts are the exceptions.
| What animates | Max | Recognized by |
|---|---|---|
| Press feedback | 160ms | active: classes, :active, Motion whileTap |
| Tooltips, hover cards | 200ms | Tooltip…, HoverCard…, PreviewCard…, role="tooltip" |
| Dropdowns, selects, menus, popovers | 250ms | DropdownMenu…, Select…, Combobox…, Popover…, Menu…, role="menu" / "listbox" |
| Everything else | 300ms | |
| Toasts | 400ms | Toast…, Toaster, Snackbar, Sonner |
| Modals, drawers, sheets | 500ms | Dialog…, Modal…, Drawer…, Sheet…, role="dialog" |
| Marketing, explanatory animations | any | exclude their files with ignore |
1234<DropdownMenu.Content className="duration-[400ms]" /> // reported: dropdowns ≤ 250ms<Dialog.Content className="duration-500" /> // fine: modals ≤ 500ms<button className="duration-300 active:scale-95" /> // reported: press feedback ≤ 160ms<motion.div transition={{ duration: 0.6 }} /> // reported: ≤ 300ms
duration-[400ms]is 400ms. Dropdowns, selects and menus stay at or under 250ms: shorter animations feel more responsive.
What animates is decided from the element’s own name or role first (unless it’s a part inside a trigger, like Select.Icon), then press feedback, then the enclosing elements, components, variables and style keys (function DialogContent, const sheetVariants = cva(…), stylex.create({ tooltip: … })). Triggers are ordinary UI: a …Trigger (TooltipTrigger, Menu.Trigger), Headless UI’s MenuButton / PopoverButton / ListboxButton / ComboboxButton, or Ariakit’s TooltipAnchor / HovercardAnchor / …Disclosure, and everything inside it (its parts like Select.Icon, its render prop), gets the press or default limit, not the overlay’s. Around a trigger, its own overlay’s root (Popover.Root, a bare DropdownMenu), other parts of it (Select.Control) and components named after it (function UserMenu) are skipped, so a trigger inside an open dialog gets the dialog’s limit. Outside a trigger, only a tooltip’s root (a bare Tooltip / HoverCard, Tooltip.Root, TooltipProvider) passes its children over (MUI and shadcn wrap the trigger in it; its own classes stay the tooltip’s); other roots (Command.Root) keep the overlay’s limit. Only the content (TooltipContent, Tooltip.Popup, Menu.Positioner, a content prop) counts as the overlay. Components imported directly from react-aria-components are the exception: there the trigger wraps the overlay and a bare Tooltip is the overlay, so they keep the overlay’s limit. React Aria wrappers re-exported from your own module are not recognized; map them with components (e.g. { "Tooltip": "tooltip" }): names configured there keep their category everywhere, with no trigger/root split. The same works for libraries whose bare Tooltip is the popup itself (react-tooltip): map it to tooltip. Inside a react-aria-components …Trigger, the trigger button keeps the overlay’s limit too. In CSS, from the selector (.dialog-content, [role=dialog], .button:active), including the outer selectors when nested. The trigger split above applies to JSX and JS only: in CSS, .tooltip-trigger still gets the tooltip’s limit.
Checked:
- Tailwind
duration-*(duration-500,duration-[0.4s]) in classes,cva/tvand@apply. - Inline styles, StyleX and CSS:
transition,transition-duration,animation,animation-duration. In shorthands only the duration counts, not the delay. - Motion:
duration/visualDuration(seconds) intransitionand inanimate/exit/whileTap/variantsobjects, also through aconstin the same file.
Not reported:
- Loops:
animate-spin/ping/pulse/bounce, Motionrepeat, and animations whose iteration count isinfinite. The count follows the cascade of the style object or CSS rule: the lastanimationoranimation-iteration-countwins,!importantfirst, and static spreads count (a conditional spread like...(on && { … })is unknown). Theanimation-namelist sets how many animations there are, and the duration and count lists repeat or truncate to it. A StyleX conditional count loops only if every branch isinfinite. Counts that can’t be read (var(--count), a dynamic spread) are not loops, except that a dynamic spread keeps theanimationshorthand’s owninfinite, and avar()item makes the wholeanimation-iteration-countlist unknown, since it can expand to several counts. - Tokens:
duration-(--slow),var(--duration-slow), custom property definitions. - Delays (
delay-700, the second time intransition).
A suggestion shortens the value to the limit (duration-300, duration: 0.3, "transform 300ms"). It isn’t an autofix, because the right value is often below the limit.
| Option | Default |
|---|---|
limits |
{ press: 160, tooltip: 200, dropdown: 250, default: 300, toast: 400, modal: 500 }, merged |
components |
{}: names → category, e.g. { "CommandPalette": "modal" } |
ignore |
[]: file globs relative to the nearest package.json (marketing pages, onboarding; Oxlint only); see monorepos |
attributes, callees, styleAttributes |
see styling |
Stylelint takes limits too: "systomic/animation-duration": [true, { limits: { default: 250 } }].