pointer-events

Class Description

pointer-events-auto

Sets pointer-events: auto. Restores normal mouse interaction.

CSS Rules

.pointer-events-auto {
  pointer-events: auto;
}

Usage

<element class="pointer-events-auto" />

Responsive

Prefix .pointer-events-auto utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:pointer-events-auto" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="pointer-events-auto:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="pointer-events-auto:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before pointer-events-auto::before" />

<element class="content-after pointer-events-auto::after" />
.pointer-events-auto Sets pointer-events: auto. Restores normal mouse interaction.

pointer-events-none

Sets pointer-events: none. Element ignores all mouse interactions and passes them through.

CSS Rules

.pointer-events-none {
  pointer-events: none;
}

Usage

<element class="pointer-events-none" />

Responsive

Prefix .pointer-events-none utility with a breakpoint variant (e.g., md:) to apply styles at specific screen sizes (Supported breakpoints are xm through 2xl).

<element class="md:pointer-events-none" />

States

States are generated dynamically at runtime and always come last. Append a state like :hover or :focus to the end of the class. This works in conjunction with breakpoints .

Supported pseudo-classes: :hover, :active, :focus, :focus-visible, :focus-within, :target, :checked, :disabled, and :group-hover.

<element class="pointer-events-none:hover" />

Group Hover Example

The :group-hover state applies styles when a parent element with the .group class is hovered.

<element class="group">
  <element class="pointer-events-none:group-hover">...</element>
</element>

Pseudo-Elements

The ::before and ::after utility classes are supported too. Granted that you add the mandatory content-before or content-after class in order for them to work.

<element class="content-before pointer-events-none::before" />

<element class="content-after pointer-events-none::after" />
.pointer-events-none Sets pointer-events: none. Element ignores all mouse interactions and passes them through.