Open this example in the interactive library
Source code
<div
class="demo data-[state=selected]:border-2 data-[state=selected]:border-teal-700"
data-state="selected"
>
Selected row
</div>
Style a selected item with a data attribute with Tailwind CSS 4 utilities. The preview uses precompiled styles.
Open this example in the interactive library
<div
class="demo data-[state=selected]:border-2 data-[state=selected]:border-teal-700"
data-state="selected"
>
Selected row
</div>