4m
Intermediate
Intermediate experience level
GuidedA passive walkthrough. Just click next to continue.
Style the control
Learn how a headless switch gets its look from data-state, and when slot attrs belong on your element.
You'll learn how to:
- 1See that the look lives in the example
- 2Watch data-state drive the thumb
- 3Find the data-state class in the example source
- 4Prefer data-state over a scripted class
- 5See why boolean data attributes are true or absent
- 6Keep ARIA and data-state on their own jobs
- 7Bind slot attrs only on a renderless host
- 8Style the next headless control the same way