An empty-state variant keeps the visual rule next to the component markup. Confirm the element truly has no children before relying on the variant.
Worked example
<div
class="demo empty:before:content-['No_results'] empty:before:text-slate-600"
></div>Implementation notes
Whitespace generated by a template can keep an otherwise blank element from matching the empty state. Prefer an explicit state attribute when business state drives the message.
Try it yourself
Insert a space or a hidden child and inspect the result.
Open the Tailwind CSS example →Editorial date March 29, 2026 · Published December 6, 2026