Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added accordion documentation #290

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions packages/components/src/components/accordion/Usage.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { Meta } from '@storybook/blocks';
import * as AccordionStories from './accordion.stories';
import AccordionElementsMobile from '../../../public-storybook/images/accordion/accordion-elements-mobile.png';
import AccordionElements from '../../../public-storybook/images/accordion/accordion-elements.png';
import AccordionStates from '../../../public-storybook/images/accordion/accordion-states.png';

<Meta of={AccordionStories} />


# Accordion
The accordion component allows users to expand and collapse content within a webpage or application. This component is commonly used for organizing and presenting large amounts of information in a compact and user-friendly manner.

## Usage

### When to use
- Frequently asked questions, product features, and other types of content where space is at a premium.

### When not to use
- If the content within the accordion is critical and necessary for users to see. Instead place the content directly on the page.
- If the content within the accordion is brief.
- If there is only one section of content that needs to be displayed.

## Anatomy
<img src={AccordionElements} alt="Accordion Anatomy" />

**Header (1)**\
Headers are the clickable elements that users can interact with to expand or collapse the accordion panel content. They consists of a Label and a Icon-Button on the left side.


**Accordion Label Text (2)**\
Describes the content within the panel.


**Collapsed State (3)**\
A chevron-down icon indicates that the panel is collapsed.


**Expanded State (4)**\
A chevron-up icon indicates that the panel is collapsed.


**Panel (5)**\
Panels are the content that appears when the user clicks on a header. They can contain text, images, or other types of content. Panels are hidden by default, and they only become visible when the user clicks on the corresponding header.


**Container (6)**\
The container is the outermost element that contains all the accordion components. The container's role is to provide a visual boundary for the accordion and to group all the headers and panels together.

## Mobile
<img src={AccordionElementsMobile} alt="Accordion Mobile" />

## States
<img src={AccordionStates} alt="Accordion States" />

***
Check out the Figma component: **[Accordion](https://www.figma.com/file/zPvPwPgb4EsYFXKC2nhzSG/Infineon-DDS-%7C-Main?type=design&node-id=19400-13883&mode=design&t=prLFLH9aC0Nm9m70-4)**.
***
Loading