Skip to content

Interactivity

Cursor

Utilities for controlling the cursor style when hovering over an element.

Quick reference

ClassDescription
cursor-autocursor: auto
cursor-defaultcursor: default
cursor-pointercursor: pointer
cursor-waitcursor: wait
cursor-textcursor: text
cursor-movecursor: move
cursor-helpcursor: help
cursor-not-allowedcursor: not-allowed
cursor-nonecursor: none
cursor-context-menucursor: context-menu
cursor-progresscursor: progress
cursor-cellcursor: cell
cursor-crosshaircursor: crosshair
cursor-vertical-textcursor: vertical-text
cursor-aliascursor: alias
cursor-copycursor: copy
cursor-no-dropcursor: no-drop
cursor-grabcursor: grab
cursor-grabbingcursor: grabbing
cursor-all-scrollcursor: all-scroll
cursor-col-resizecursor: col-resize
cursor-row-resizecursor: row-resize
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-zoom-incursor: zoom-in
cursor-zoom-outcursor: zoom-out

Basic usage

Setting the cursor style

Use the cursor-{style} to control which cursor is displayed when hovering over an element.

cursor-auto
cursor-pointer
cursor-none
html
<div class="cursor-auto ...">cursor-auto</div>
<div class="cursor-pointer ...">cursor-pointer</div>
<div class="cursor-none ...">cursor-none</div>

Applying conditionally

Hover, focus, and other states

Warp lets you conditionally apply utility classes in different states using variant modifiers. For example, use focus:cursor-auto to only apply the cursor-auto utility on focus.

html
<div class="cursor-not-allowed focus:cursor-auto"></div>

Breakpoints and media queries

You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. For example, use md:cursor-auto to apply the cursor-auto utility at only medium screen sizes and above.

html
<div class="cursor-not-allowed md:cursor-auto"></div>