systomic

Interactive cursor

Some products show the hand on everything you can click, others keep the arrow like native buttons. Either works; a mix of both doesn't. Pick one and every clickable element follows it.

  • 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).
  • Autofixoxlint --fix fixes it for you.

See the difference

Before
className="px-3 py-1.5"
After
className="px-3 py-1.5 cursor-pointer"

What doesn't work

2 findings

What works

No findings

Details

Clickable elements use one cursor across the product. Some teams want the pointer (hand) on everything you can click, others keep the default arrow like native buttons do. Either is fine; mixing both is not. Pick one with the cursor option.

cursor: "pointer"

<button> is clickable but has no cursor-pointer. Clickable elements show the pointer cursor in this product.

The autofix appends cursor-pointer to a plain className string, or adds className="cursor-pointer" when there is none. Any cursor counts as a decision: cursor-grab on a drag handle, cursor-not-allowed, hover:cursor-pointer, or cursor in inline styles and StyleX.

cursor: "default"

<button> sets cursor-pointer. Clickable elements keep the default cursor in this product, like native buttons.

The autofix removes the class (with any variant). cursor: "pointer" in inline styles and StyleX is reported without a fix.

What counts as clickable

Intrinsic elements only (components set their cursor where they render the element):

  • button, select, summary,
  • input of type checkbox, radio, submit, button, reset, file, range, color, image (text inputs keep the text cursor),
  • role="button", "link", "tab", "checkbox", "radio", "switch", "slider", "menuitem", "option", …,
  • any element with onClick, onPointerDown, onPointerUp, onMouseDown or onMouseUp,
  • <a> without href but with a click handler. Links with href get the pointer from the browser and are left alone.

Not reported: aria-hidden="true" elements, and elements whose classes come from props (className={cn("px-3", className)}, props.className) or that spread props after the class attribute, since those may carry the cursor.

CSS (Stylelint)

Not in the Stylelint preset: a stylesheet can’t see a global reset in another file (button { cursor: pointer }) or classes on the element. Enable it when components are styled in CSS:

  • pointer: a stateless rule for a class that names a control (.icon-button, .tab-trigger, .menu-item) needs a cursor in one of that class’s rules (:hover and @apply cursor-* count).
  • default: cursor: pointer on those selectors, button and [role=…] is reported and removed.
Option Default
cursor "pointer", or "default"
ignore []: file globs relative to the nearest package.json (Oxlint only); see monorepos
attributes, callees, styleAttributes see styling
Esc