Skip to content

cursor

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

Source: https://tailwindcss.com/guide/cursor

Quick reference

ClassStyles
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;
cursor-(<custom-property>)cursor: var(<custom-property>);
cursor-[<value>]cursor: <value>;

Examples

Basic example

Use utilities like cursor-pointer and cursor-grab to control which cursor is displayed when hovering over an element:

html
<button class="cursor-pointer ...">Submit</button>
<button class="cursor-progress ...">Saving...</button>
<button class="cursor-not-allowed ..." disabled>Confirm</button>

Using a custom value

Use the cursor-[&lt;value&gt;] syntax to set the cursor based on a completely custom value:

html
<button class="cursor-[url(hand.cur),_pointer] ...">
  <!-- ... -->
</button>

For CSS variables, you can also use the cursor-(&lt;custom-property&gt;) syntax:

html
<button class="cursor-(--my-cursor) ...">
  <!-- ... -->
</button>

This is just a shorthand for cursor-[var(&lt;custom-property&gt;)] that adds the var() function for you automatically.

Responsive design

Prefix a cursor utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:

html
<button class="cursor-not-allowed md:cursor-auto ...">
  <!-- ... -->
</button>

Learn more about using variants in the variants documentation.

Released under the MIT License.