Dev Helpers

Tailwind CSS / Forms and controls

Make a text cursor easier to see

Dev Helpers · August 28, 2025

A caret utility changes the insertion indicator independently of text colour. Match its contrast to the input surface in both themes.

Worked example

<input
  class="demo caret-rose-700"
  aria-label="Edit title"
  value="Edit description"
/>

Implementation notes

Caret colour has little effect on non-text controls. Apply the utility to the actual editable element rather than its field wrapper.

Try it yourself

Toggle the theme with the input focused.

Open the Tailwind CSS example →

Editorial date August 28, 2025 · Published December 6, 2026

Related articles

Selection background swatch

The selection variant lets a component specify its own selected-text colours. Readability depends on the selected foreground as well as the highlight.

Skew a label

A skew utility changes the painted shape without allocating extra room for the slanted edge. A separate inner wrapper can keep lettering upright.

Horizontal flex row

Flex utilities define the row but children can still resist shrinking. Inspect long labels before adding more breakpoints.