ONGOING
Description
An accordion is a list of headers that hide or reveal additional content when selected.
Usage & Behavior
An accordion should be used when
- If users will only need a few specific pieces of content within a page.
- If you have only a small space to display a lot of content.
General guidelines
Internal Logic
The accordion component delivers large amounts of content in a small space through progressive disclosure.
- The user gets key details about the underlying content and can choose to expand that content within the constraints of the accordion.
- Accordions work especially well whenever vertical space is limited.
Text
Use clear labels - Accordions hide content, so the labels need to be clear.
structure
Header
Header content of the Accordion can wrap, but it is recommended that it is short and to the point.
Content
There is no limit to the height of an open section, however, follow the other padding specs below.
Section content should have a minimum of 3 rows
The width of an accordion varies based on the content, layout, and page design. The chevron icon can be found on the LUX Icon Font.
Scrolling
Accordions take up 100% width of their parent container.
Only 1 content can be viewed at a time
States
Structure Element | Description |
---|---|
Section header close | |
Section header open | |
Section header hover | |
Selected content mark | |
Section header with checkbox | |
Section header with warning | |
Open/Close section animation |
Interaction
- You can Click on the entire accordion Section Header
- Theres always one section open in the accordion, and only one
- Scrolling will be added to section content that exceed the height of the accordion container
- Hovering over section header will show a tooltip with the full name of the section header
Best practices
When to use the accordion component
- If users will only need a few specific pieces of content within a page.
- If you have only a small space to display a lot of content.
When to consider something else
- If users need to see most or all of the information on a page. Use well-formatted text instead.
- If there is not enough content to warrant condensing. Accordions increase cognitive load and interaction cost, as users have to make decisions about what headers to click on.
Usability guidance
- Make the entire header selectable. Allow users to click anywhere in the header area to expand or collapse the content; a larger target is easier to manipulate.
- Give interactive elements enough space. Make sure interactive elements within the collapsible region are far enough from the headers that users don’t accidentally trigger a collapse. (The exact distance depends on the device.)
Accessibility compliance
<<In general each component should be A11y complied, please follow the 3 guidelines linked below. At the very least we should document that each component is in compliance with each of the 3>>
Focus management
<<How will the component work with keyboard only - without a mouse. Can be reference if written above
We already set a general guidelines described in /wiki/spaces/UX/pages/308969693 >>
Screen reader support
<<Make sure the components support screen reader for content or behaviour where needed - see /wiki/spaces/UX/pages/308248620 >>
Contrast & size compliance
<<Visual designers must comply with the minimal of /wiki/spaces/UX/pages/301498483 for each component>>
Design
Zeplin link | Screen thumbnail |
---|---|
https://zpl.io/VkmX6dq | |
Code
<<a box containing the code - discuss with Femi>>