Dev Helpers

Tailwind CSS / Tailwind state variants

Placeholder shown outline

Dev Helpers · September 15, 2025

A placeholder-shown variant represents a specific input state. It depends on placeholder behaviour and does not replace an accessible field label.

Worked example

<input
  class="demo placeholder-shown:border-dashed placeholder-shown:border-2"
  placeholder="Project title"
  aria-label="Project title"
/>

Implementation notes

A filled input can return to its placeholder state after reset. Test the complete interaction rather than only the untouched field.

Try it yourself

Focus, type and clear the field while watching its outline.

Open the Tailwind CSS example →

Editorial date September 15, 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.