User Select

Utilities for controlling whether the user can select text in an element.

Change the way in which the content is selected when the user interacts with it.

Quick reference

ClassProperties
.user-select-alluser-select: all;
.user-select-autouser-select: auto;
.user-select-noneuser-select: none;

Basic usage

Selecting all text in one click

Use user-select-all to automatically select all the text in an element when a user clicks.

Try selecting the text to see the expected behaviour

The quick brown fox jumps over the lazy dog.
<div class="user-select-all fw-semibold">The quick brown fox jumps over the lazy dog.</div>

Using auto select behaviour

Use user-select-auto to use the default browser behavior for selecting text. Useful for undoing other classes like .user-select-none at different breakpoints.

Try selecting the text to see the expected behaviour

The quick brown fox jumps over the lazy dog.
<div class="user-select-auto fw-semibold">The quick brown fox jumps over the lazy dog.</div>

Disabling text selection

Use user-select-none to prevent selecting text in an element and its children.

Try selecting the text to see the expected behaviour

The quick brown fox jumps over the lazy dog.
<div class="user-select-none fw-semibold">The quick brown fox jumps over the lazy dog.</div>