Skip to content

Data Attributes

A reference table of the data attributes a component sets, read from the page’s front matter.

View source View as Markdown

A data attributes table lists the attributes a component sets on its elements. The rows live in the page’s front matter, where tools can read them as data.

PartAttributeValue
Accordion.View
data-active
true
Accordion.Trigger
data-disabled
true
Accordion.Content
data-state
open | closed

Usage

List the attributes under dataAttributes, then place the table.

---
dataAttributes:
  - attribute: data-state
    part: Accordion.Content
    values: 'open | closed'
    description: Always present.
---

::data-attributes
::

An attribute without values is a flag and reads true. With part, the table lists only the attributes of that part.

::data-attributes{part="Accordion.View"}
::
AttributeValue
data-active
true