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"].

Product Ratings

4.5 Excellent
3.2 Good
2.1 Fair
4.9 Outstanding

Toggle States

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.