data-* Attributes
Custom data-* attributes store private metadata on any element — no JS API needed, and CSS can target them with attribute selectors like [data-state="active"].
Toggle States
- Dark mode — on
- Analytics — off
- Sync — in progress
- Auto-save — on
CSS magic: [data-rate="4.5"] .stars and [data-state="loading"]::before let HTML carry state and style react to it — zero JavaScript required for pure presentation toggles.