Skip to content

Cursor

Cursor utilities set the cursor property: the pointer shown when a mouse hovers an element. Each class is named after its CSS value: cursor-pointer is cursor: pointer.

  • One class per value. cursor-{value} for 32 standard CSS cursor values. There is no configuration map and no token.
  • Mouse only. Cursors appear only for mouse and other fine pointers. Touch screens show no cursor, so a cursor must never be the only sign that something is interactive.
Group Classes
General cursor-auto, cursor-default, cursor-none
Links and status cursor-pointer, cursor-help, cursor-context-menu, cursor-progress, cursor-wait, cursor-not-allowed
Selection cursor-text, cursor-cell, cursor-crosshair
Drag and drop cursor-move, cursor-grab, cursor-grabbing, cursor-all-scroll
Zoom cursor-zoom-in, cursor-zoom-out
Resize cursor-col-resize, cursor-row-resize, cursor-n-resize, cursor-e-resize, cursor-s-resize, cursor-w-resize, cursor-ne-resize, cursor-nw-resize, cursor-se-resize, cursor-sw-resize, cursor-ew-resize, cursor-ns-resize, cursor-nesw-resize, cursor-nwse-resize

Hover each box to see its cursor:

pointer
help
not-allowed
wait
progress
text
crosshair
move
grab
grabbing
zoom-in
col-resize
<div class="flex wrap gap-2">
<div class="cursor-pointer p-3 bg-alternate rounded">pointer</div>
<div class="cursor-help p-3 bg-alternate rounded">help</div>
<div class="cursor-not-allowed p-3 bg-alternate rounded">not-allowed</div>
<div class="cursor-wait p-3 bg-alternate rounded">wait</div>
<div class="cursor-progress p-3 bg-alternate rounded">progress</div>
<div class="cursor-text p-3 bg-alternate rounded">text</div>
<div class="cursor-crosshair p-3 bg-alternate rounded">crosshair</div>
<div class="cursor-move p-3 bg-alternate rounded">move</div>
<div class="cursor-grab p-3 bg-alternate rounded">grab</div>
<div class="cursor-grabbing p-3 bg-alternate rounded">grabbing</div>
<div class="cursor-zoom-in p-3 bg-alternate rounded">zoom-in</div>
<div class="cursor-col-resize p-3 bg-alternate rounded">col-resize</div>
</div>
  • cursor-pointer on a custom clickable element that is not a link or button, such as a whole card that links somewhere. Native links already show the pointer.
  • cursor-not-allowed on a disabled control, together with the disabled attribute or aria-disabled="true".
  • cursor-grab on a draggable handle at rest, and cursor-grabbing while it is dragged (add the class from your drag code).
  • cursor-col-resize and cursor-row-resize on splitter bars between panes.
  • cursor-wait while the whole page is blocked; cursor-progress while work continues in the background and the page is still usable.
Drag handle
<div class="flex wrap gap-3 x-center">
<button type="button" disabled class="cursor-not-allowed">Disabled</button>
<div class="cursor-grab p-3 border border-dashed rounded">Drag handle</div>
</div>

Cursor classes have no responsive and no state variants. A cursor already shows only on hover, so a hover: form is not needed. To change the cursor in a state, use the mixin with a state modifier:

.row {
@include apply(cursor(default), cursor(pointer) hover);
}

cursor() writes its argument as is, so it accepts any CSS cursor value, including image cursors with a fallback.

@use "@nuvoui/core" as *;
.card-link {
@include apply(cursor(pointer));
}
.canvas {
@include apply(cursor((url("/cursors/pen.svg") 4 4, crosshair)));
}
.card-link {
cursor: pointer;
}
.canvas {
cursor: url("/cursors/pen.svg") 4 4, crosshair;
}

cursor() does not validate its value; a misspelled value is emitted as written and ignored by the browser. cursor() takes one argument, so wrap a value that contains commas, such as an image with a fallback, in parentheses: cursor((url(...) 4 4, crosshair)). Without them Sass reports Only 1 argument allowed, but 2 were passed.

The list of cursor classes is fixed. Turn the classes off with the cursors feature flag; the mixin stays available. A flag missing from your $feature-flags map counts as on, so the map below turns off cursor classes only.

@use "@nuvoui/core" with (
$generate-utility-classes: true,
$feature-flags: ("cursors": false)
);

Generated from the compiled core build.

Cursor (32 rules)
SelectorDeclarationsDefault value
.cursor-autocursor: autoauto
.cursor-pointercursor: pointerpointer
.cursor-defaultcursor: defaultdefault
.cursor-movecursor: movemove
.cursor-not-allowedcursor: not-allowednot-allowed
.cursor-waitcursor: waitwait
.cursor-helpcursor: helphelp
.cursor-textcursor: texttext
.cursor-cellcursor: cellcell
.cursor-crosshaircursor: crosshaircrosshair
.cursor-grabbingcursor: grabbinggrabbing
.cursor-grabcursor: grabgrab
.cursor-zoom-incursor: zoom-inzoom-in
.cursor-zoom-outcursor: zoom-outzoom-out
.cursor-nonecursor: nonenone
.cursor-progresscursor: progressprogress
.cursor-col-resizecursor: col-resizecol-resize
.cursor-row-resizecursor: row-resizerow-resize
.cursor-n-resizecursor: n-resizen-resize
.cursor-e-resizecursor: e-resizee-resize
.cursor-s-resizecursor: s-resizes-resize
.cursor-w-resizecursor: w-resizew-resize
.cursor-ne-resizecursor: ne-resizene-resize
.cursor-nw-resizecursor: nw-resizenw-resize
.cursor-se-resizecursor: se-resizese-resize
.cursor-sw-resizecursor: sw-resizesw-resize
.cursor-ew-resizecursor: ew-resizeew-resize
.cursor-ns-resizecursor: ns-resizens-resize
.cursor-nesw-resizecursor: nesw-resizenesw-resize
.cursor-nwse-resizecursor: nwse-resizenwse-resize
.cursor-context-menucursor: context-menucontext-menu
.cursor-all-scrollcursor: all-scrollall-scroll
  • Cursor is not semantics. cursor-pointer on a div does not make it a button. Use a real button or a element so keyboard and screen reader users can reach and operate it (WCAG 4.1.2 Name, Role, Value).
  • Do not hide the cursor without a replacement. cursor-none is for media players and canvases that draw their own pointer.
  • Touch. Touch devices show no cursor; disabled and draggable states also need a visible style.
  • RTL. Cursor values are not mirrored by the browser. cursor-e-resize points right in both directions; for a handle on the inline end side, choose the cursor in your SCSS from the direction if needed.