HTML element to use for accordion
Optional
config: AccordionConfig = {}Accordion config
Private
$modulePrivate
$sectionsPrivate
$showPrivate
$showPrivate
$showPrivate
browserPrivate
configPrivate
controlsPrivate
downPrivate
i18nPrivate
sectionPrivate
sectionPrivate
sectionPrivate
sectionPrivate
sectionPrivate
sectionPrivate
sectionPrivate
sectionPrivate
sectionPrivate
sectionPrivate
sectionPrivate
sectionPrivate
sectionPrivate
sectionPrivate
showPrivate
showPrivate
upStatic
defaultsAccordion default config
Static
moduleName for the component used when initialising using data-module attributes.
Private
checkPrivate
constructPrivate
getPrivate
Create an element to improve semantics of the section button with punctuation
Adding punctuation to the button can also improve its general semantics by dividing its contents into thematic chunks. See https://github.com/alphagov/govuk-frontend/issues/2327#issuecomment-922957442
DOM element
Private
initPrivate
initPrivate
isPrivate
onPrivate
onPrivate
onPrivate
setPrivate
setPrivate
storePrivate
updateGenerated using TypeDoc
Accordion component
This allows a collection of sections to be collapsed by default, showing only their headers. Sections can be expanded or collapsed individually by clicking their headers. A "Show all sections" button is also added to the top of the accordion, which switches to "Hide all sections" when all the sections are expanded.
The state of each section is saved to the DOM via the
aria-expanded
attribute, which also provides accessibility.Preserve