Interactivity

cursor

Setting the mouse cursor style.

Overview

ClassDeclarations
cursor:nonecursor: none;
cursor:autocursor: auto;
cursor:defaultcursor: default;
cursor:pointercursor: pointer;
cursor:textcursor: text;
cursor:movecursor: move;
cursor:vertical-textcursor: vertical-text;
cursor:aliascursor: alias;
cursor:all-scrollcursor: all-scroll;
cursor:cellcursor: cell;
cursor:col-resizecursor: col-resize;
cursor:row-resizecursor: row-resize;
cursor:context-menucursor: context-menu;
cursor:copycursor: copy;
cursor:crosshaircursor: crosshair;
cursor:grabcursor: grab;
cursor:grabbingcursor: grabbing;
cursor:n-resizecursor: n-resize;
cursor:e-resizecursor: e-resize;
cursor:s-resizecursor: s-resize;
cursor:w-resizecursor: w-resize;
cursor:ne-resizecursor: ne-resize;
cursor:nw-resizecursor: nw-resize;
cursor:se-resizecursor: se-resize;
cursor:sw-resizecursor: sw-resize;
cursor:ew-resizecursor: ew-resize;
cursor:ns-resizecursor: ns-resize;
cursor:nesw-resizecursor: nesw-resize;
cursor:nwse-resizecursor: nwse-resize;
cursor:no-dropcursor: no-drop;
cursor:not-allowedcursor: not-allowed;
cursor:progresscursor: progress;
cursor:waitcursor: wait;
cursor:zoom-incursor: zoom-in;
cursor:zoom-outcursor: zoom-out;
cursor:<value>cursor: <value>;

cursor requests a pointer shape over an element. The operating system and input device determine its appearance; a shape does not create an action or disable a control.

Examples

Show clickable affordance

Use cursor:pointer on a real disclosure control. Click or press Enter on the summary to reveal its setting.

Show clickable affordance
The cursor is a platform-rendered affordance. Try the real disclosure, reset control or native draggable image; the cursor itself does not implement the action.
<details>  <summary id="target"    class="p-sm b:1px|solid|var(--color-line-base) r-sm cursor:pointer">Canvas settings</summary>  <label class="flex items-center gap-sm mt-md">    <input type="checkbox"> Show grid  </label></details>
Generated CSS
@layer utilities {  .cursor\:pointer {    cursor: pointer  }}

The native summary already supplies focus, keyboard activation and expanded state. A div with a pointer cursor would not provide those behaviors.

Mark disabled actions

Pair cursor:not-allowed with the native disabled attribute. The cursor is a visual cue; disabled is what prevents the reset action.

Mark disabled actions
The cursor is a platform-rendered affordance. Try the real disclosure, reset control or native draggable image; the cursor itself does not implement the action.
<form class="grid justify-items:start gap-md">  <label class="grid gap-xs w:240px max-w:100%">    Project name <input type="text" value="Canvas" class="w:100%">  </label>  <button id="target" type="reset" disabled    class="opacity:.6 cursor:not-allowed">    Reset unavailable  </button>  <button type="reset">Reset name</button></form>

Edit the name first, then compare the disabled button with the enabled reset. aria-disabled alone would not prevent activation; a custom control must implement that behavior.

Support drag handles

Use cursor:grab with cursor:grabbing:active on content that really participates in native dragging. This image has draggable="true".

Support drag handles
The cursor is a platform-rendered affordance. Try the real disclosure, reset control or native draggable image; the cursor itself does not implement the action.
<img id="target" src="/demo/landscape.svg" alt="Sun above layered mountains"  width="240" height="144"  class="block h:auto w:240px max-w:100% r-sm         cursor:grab cursor:grabbing:active" draggable="true"><p class="mb:0 mt-sm font-xs text-muted">Drag the image, or <a href="/demo/landscape.svg" download>download the artwork</a>.</p>

The grabbing style applies while the element is active. Once native dragging begins, the operating system may show its own drag feedback. These classes do not implement reordering or a drop target.

Apply conditionally

Resize to request cursor:pointer at sm and cursor:default below it. The disclosure opens with the mouse or keyboard at either width.

Apply conditionally
cursor: Apply conditionally controls
The cursor is a platform-rendered affordance. Try the real disclosure, reset control or native draggable image; the cursor itself does not implement the action.
<details>  <summary id="target"  class="p-sm b:1px|solid|var(--color-line-base) r-sm cursor:default         cursor:auto@print cursor:pointer@screen@sm">Canvas settings</summary>  <label class="flex items-center gap-sm mt-md">    <input type="checkbox"> Show grid  </label></details>

Hover with a pointing device to inspect the native cursor. Touch devices may show no cursor even though the computed value changes.



© 2026 Aoyue Design LLC.MIT License
Trademark Policy