Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Usage | Anatomy | Visual style | Editorial | Behaviour | Accessibility | Related components

Panel
panelIconId1f517293035db-a48a-4d92-a968-8e1e6c7285d6
panelIcon:linkFigma:
panelIconText🔗:Figma:
bgColor#F4F5F7

Figma component link

Panel
panelIconId1f517efa8ba60-1dab-4e63-8948-4ff4366ce32a
panelIcon:linkStorybook:
panelIconText🔗:Storybook:
bgColor#F4F5F7

Storybook component


The Disclosure component lets users show and hide sections of related content on a page. Content within disclosures are generally considered supporting content that only a subset of users will find relevant.

Usage

Table of Contents
minLevel1
maxLevel2
indent0
stylecircle
separatorpipe

Usage

Tip

Do’s

  • Use

disclosures when you want to provide relevant or related information without cluttering the page.
  • a disclosure to hide a single piece of related content.

  • Use a disclosure when the content is relevant to a small subset of users.

Warning

Dont’s

  • Don’t use a disclosure when content is relevant to all users

.Don’t use disclosures in list
  • .

Use Accordion instead.
  • Don’t use a disclosure when content within the

accordion
  • disclosure is very complex or can cause slow page loads.

Anatomy

Warning

Insert image here

 

Image Added

n/a

Item

Component type

Content type

Notes

1

List item

 

Text

 

Open icon

Icon

SVG

Status
colourRed
titleMandatory

2

Item title

 

Typography

Text

 

Status
colourRed
titleMandatory

3

Item content

 

RTA

 

Visual style

Close icon

Icon

SVG

Status
colourRed
titleMandatory

4

Disclosure content

Any component

Any

Status
colourRed
titleMandatory

Visual style

The disclosure component has no additional visual styles but can be considered a sibling of the Accordion component. The disclosure’s style is visually less prominent by reducing size and removing borders.

Disclosures will generally be restricted to a single draw and is used to house peripheral content that isn’t relevant to all users. Two examples of this are product ingredient pack details and video transcripts.

If you have a lot of related content like an FAQ, we recommend you use the Accordion.

Editorial

  • Keep disclosure titles short, but long enough to clearly communicate what a user can expect to find inside. This is especially required for unsighted users.

Behaviour

  • Disclosure items are collapsed by default.

  • Disclosures are individually controlled with a toggle between expanded and collapsed.

  • Disclosures Disclosure’s includes hover, focus and disabled and active states. CSS ‘focus-visible’ will remove visual focus for mouse-controlled accordions.

  • Mouse click or touch on the disclosure Disclosure title will toggle between expand and collapse.

  • Once focused, Enter or Space on a keyboard will toggle expand or collapse.

  • Where Javascript is disabled, all disclosures are the disclosure is expanded by default and expand/collapse controls are not present.

Accessibility

 

Related components

  

  • The control is a <button> which toggles aria-expanded between “true” and “false”.

  • The icon is deliberately placed before the title (left on LTR languages and right on RTL languages) to aid users of screen magnifiers, who may not be able to see the status if it was right aligned on a wide disclosure.

  • Collapsed content shouldn’t be visible to users or screen-readers. (e.g. display:none).

  • Disclosures can be configured with multiple semantic elements.

    • <div> Use when the drawer title is not a heading (e.g. a paragraph). Using section here would create a section without a heading which is bad practice.

    • <details> An accessible html element that creates a disclosure widget and wraps the item title in a <summary> tag.

    • <dl> Most appropriately used for FAQ lists and although it looks the same, it should be noted that the drawer titles will not be headings semantically and so won't be as easily navigable by screen-reader users, but the list will appear to them.