systomic

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.

  • RuleIn recommended.json: breaking it breaks the design-system contract.
  • WarningShows in the editor and in CI output, but doesn't fail the run (unless you pass --deny-warnings).
  • StylelintThe same check runs on .css and .scss files through the Stylelint plugin.
  • Suggested fixSuggests a replacement your editor can apply. It changes how the UI looks or moves, so oxlint --fix leaves it to you.

See the difference

Before
className="duration-[400ms]"
After
className="duration-200"

What doesn't work

Oxlint

5 findings

Stylelint

2 findings

What works

No findings

Oxlint

Stylelint

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

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 / tv and @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) in transition and in animate / exit / whileTap / variants objects, also through a const in the same file.

Not reported:

  • Loops: animate-spin / ping / pulse / bounce, Motion repeat, and animations whose iteration count is infinite. The count follows the cascade of the style object or CSS rule: the last animation or animation-iteration-count wins, !important first, and static spreads count (a conditional spread like ...(on && { … }) is unknown). The animation-name list 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 is infinite. Counts that can’t be read (var(--count), a dynamic spread) are not loops, except that a dynamic spread keeps the animation shorthand’s own infinite, and a var() item makes the whole animation-iteration-count list unknown, since it can expand to several counts.
  • Tokens: duration-(--slow), var(--duration-slow), custom property definitions.
  • Delays (delay-700, the second time in transition).

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 } }].

Esc