Open this example in the interactive library
Source code
<input class="demo peer" type="checkbox" id="flag" /><label
class="peer-checked:font-bold peer-checked:text-teal-700"
for="flag"
>Show completed</label
>
Change a label when its input is checked with Tailwind CSS 4 utilities. The preview uses precompiled styles.
Open this example in the interactive library
<input class="demo peer" type="checkbox" id="flag" /><label
class="peer-checked:font-bold peer-checked:text-teal-700"
for="flag"
>Show completed</label
>