Tailwind CSS Interactivity
Tailwind's interactivity utilities give you fine-grained control over how users interact with elements on the page, from cursor styles and text selection behaviour to scroll control and native form appearance.
These utilities cover a range of CSS properties that are often overlooked but can have a significant impact on the feel and usability of an interface. Many of these are excellent candidates for pairing with state variants like hover:, focus:, and disabled:.
Cursor
You can use cursor-{type} to control the mouse cursor style when hovering over an element. This is one of the most frequently applied interactivity utilities, as it helps communicate affordances, whether something is clickable, draggable, or disabled.
Common cursor styles:
| Utility | CSS Output | Best Use Case |
|---|---|---|
cursor-pointer |
cursor: pointer; |
Buttons, links, and any clickable element. |
cursor-default |
cursor: default; |
Resetting cursor to the browser default. |
cursor-not-allowed |
cursor: not-allowed; |
Disabled buttons or restricted actions. |
cursor-wait |
cursor: wait; |
Loading states while an async operation runs. |
cursor-grab / cursor-grabbing |
cursor: grab; |
Draggable elements like carousels or kanban cards. |
cursor-text |
cursor: text; |
Editable text areas or inline inputs. |
cursor-crosshair |
cursor: crosshair; |
Drawing tools or image cropping interfaces. |
cursor-zoom-in / cursor-zoom-out |
cursor: zoom-in; |
Image galleries or map zoom controls. |
You can also use arbitrary values to specify any valid CSS cursor: cursor-[url('/my-cursor.png'),_auto]. And as you might expect, you can also use CSS variables like cursor-[var(--my-cursor)].
Pointer Events
The pointer-events utilities control whether an element can receive mouse or touch events at all. This is subtly different from just disabling a button because pointer-events-none makes an element completely "invisible" to the pointer, so events pass through to whatever is behind it.
Here are the pointer events utilities:
| Utility | CSS Output | Description |
|---|---|---|
pointer-events-none |
pointer-events: none; |
Element ignores all pointer events. Clicks pass through to elements underneath. |
pointer-events-auto |
pointer-events: auto; |
Restores default pointer event handling (useful for resetting inside a pointer-events-none parent). |
User Select
The select-{option} utilities control whether and how a user can select text within an element. This can be useful for preventing selection in UI controls, or for making it easy to copy a code snippet in one click.
Here are the user select utilities:
| Utility | CSS Output | Description |
|---|---|---|
select-none |
user-select: none; |
Prevents text selection. Useful for buttons and labels. |
select-text |
user-select: text; |
Allows text selection (restores browser default). |
select-all |
user-select: all; |
Selects all content in one click. Great for code snippets or API keys. |
select-auto |
user-select: auto; |
Reverts to the browser's default selection behaviour. |
Resize
The resize-{axis} utilities control whether a user can resize an element by dragging a handle, usually applied to textarea elements:
| Utility | CSS Output | Description |
|---|---|---|
resize |
resize: both; |
User can resize both horizontally and vertically. |
resize-x |
resize: horizontal; |
User can only resize horizontally. |
resize-y |
resize: vertical; |
User can only resize vertically (most common for textareas). |
resize-none |
resize: none; |
Disables resizing entirely. |
Overflow & Scroll Behavior
The overflow-{value} utilities control what happens when content exceeds an element's bounds. They map directly to the CSS overflow property. You can also combine them with scroll-smooth for a more polished feel when using anchor navigation.
Here's a breakdown of the overflow and scroll behavior utilities:
| Category | Utilities | Description |
|---|---|---|
| Overflow |
|
Controls whether content is clipped, scrollable, or visible. Also composable with overflow-x-* and overflow-y-*. |
| Scroll Behaviour |
|
Whether anchor link navigation animates smoothly or jumps instantly. |
| Scroll Snap |
|
Creates a scroll-snapping container and defines where items should snap to. |
| Overscroll |
|
Prevents scroll chaining and keeps momentum scrolling within the element. You can also use the overscroll-x-* and overscroll-y-* utilities to control the overscroll behavior for each axis independently. |
Appearance & Accent Color
The following utilities control how native browser form controls look:
appearance-none: Strips the browser's default styling from a form element likeselectorinput, giving you a blank canvas to restyle it completely. You can restore default browser styling by using theappearance-autoutility.accent-{color}: Applies a theme color to native form controls like checkboxes, radio buttons, and range sliders without requiringappearance-none. This is a simpler alternative when you just want branded colours on native inputs. For example,accent-blue-600oraccent-(--brand-color):
Examples
Here are examples of some of the interactivity utilities in action:
Next we'll look at how you can use plugins to extend Tailwind CSS.