<usa-details name="example-group-name">
<details open="true">
<summary>First Amendment</summary>
<div slot="details-body">Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances.</div>
</details>
<details>
<summary>Second Amendment</summary>
<div slot="details-body">A well regulated Militia, being necessary to the security of a free State, the right of the people to keep and bear Arms, shall not be infringed.</div>
</details>
<details>
<summary>Third Amendment</summary>
<div slot="details-body">No Soldier shall, in time of peace be quartered in any house, without the consent of the Owner, nor in time of war, but in a manner to be prescribed by law.</div>
</details>
</usa-details>
If the open attribute is present on the <details> element, the content inside its details-content slot should be visible on load.
name="[group name]"
<details>
If a defined name attribute is present on the <details> element, the <details> elements with the same name value will be treated as a single-select group and toggle each other.
Summary
Created an alpha version of a
usa-details
web componentRelated issue
Closes #19
Preview link
Details component (Storybook)
Sample implementation
Reference
Details element (MDN)
Requirements notes (WIP)
Common component names
Details, Accordion, Collapse
Variants
Settings and CSS Variables
$theme-accordion-border-width
--theme-details-border-width
$theme-accordion-border-color
--theme-details-border-color
$theme-accordion-button-background-color
--theme-details-summary-background-color
$theme-accordion-background-color
--theme-details-background-color
$theme-accordion-font-family
--theme-details-font-family
Possibilities for additional customization:
Accessibility
See related accessibility tests
Attributes & Props
open="true"
<details>
open
attribute is present on the<details>
element, the content inside itsdetails-content
slot should be visible on load.name="[group name]"
<details>
name
attribute is present on the<details>
element, the<details>
elements with the samename
value will be treated as a single-select group and toggle each other.Slots
details-body
<div>
<div slot="details-body">[Accordion panel content]</div>
Expected interactions:
enter
,spacebar
, mouse click, or voice commandTest cases