Properties Private
$module $module : HTMLElement
Private
$sections $sections : NodeListOf < Element >
Private
$show All Button $show All Button : HTMLButtonElement = null
Private
$show All Icon $show All Icon : HTMLElement = null
Private
$show All Text $show All Text : HTMLElement = null
Private
browser Supports Session Storage browser Supports Session Storage : boolean = false
Private
controls Class controls Class : string = 'govuk-accordion__controls'
Private
down Chevron Icon Class down Chevron Icon Class : string = 'govuk-accordion-nav__chevron--down'
Private
section Button Class section Button Class : string = 'govuk-accordion__section-button'
Private
section Class section Class : string = 'govuk-accordion__section'
Private
section Content Class section Content Class : string = 'govuk-accordion__section-content'
Private
section Expanded Class section Expanded Class : string = 'govuk-accordion__section--expanded'
Private
section Header Class section Header Class : string = 'govuk-accordion__section-header'
Private
section Heading Class section Heading Class : string = 'govuk-accordion__section-heading'
Private
section Heading Divider Class section Heading Divider Class : string = 'govuk-accordion__section-heading-divider'
Private
section Heading Text Class section Heading Text Class : string = 'govuk-accordion__section-heading-text'
Private
section Heading Text Focus Class section Heading Text Focus Class : string = 'govuk-accordion__section-heading-text-focus'
Private
section Show Hide Text Class section Show Hide Text Class : string = 'govuk-accordion__section-toggle-text'
Private
section Show Hide Toggle Class section Show Hide Toggle Class : string = 'govuk-accordion__section-toggle'
Private
section Show Hide Toggle Focus Class section Show Hide Toggle Focus Class : string = 'govuk-accordion__section-toggle-focus'
Private
section Summary Class section Summary Class : string = 'govuk-accordion__section-summary'
Private
section Summary Focus Class section Summary Focus Class : string = 'govuk-accordion__section-summary-focus'
Private
show All Class show All Class : string = 'govuk-accordion__show-all'
Private
show All Text Class show All Text Class : string = 'govuk-accordion__show-all-text'
Private
up Chevron Icon Class up Chevron Icon Class : string = 'govuk-accordion-nav__chevron'
Static
module Name module Name : string = 'govuk-accordion'
Static
schema schema : Readonly < { properties : { i18n : { type : "object" ; } ; rememberExpanded : { type : "boolean" ; } ; } ; } > = ...
Type declaration properties : { i18n : { type : "object" ; } ; rememberExpanded : { type : "boolean" ; } ; } i18n : { type : "object" ; } remember Expanded : { type : "boolean" ; }
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