# Accordion URL: /components/accordion Source: https://github.com/daangn/seed-design/blob/dev/docs/content/components/accordion.mdx A vertically stacked list component that lets you progressively reveal detailed information. ## Anatomy Accordion consists of a Trigger (Prefix, Title, Description, Chevron Icon) and Custom Content shown when expanded. The Trigger is the area a user clicks to open and close the content. It includes Prefix, Title, Description, and Chevron Icon. ![Anatomy image of Accordion. Consists of a Trigger (Prefix, Title, Description, Chevron Icon) and Custom Content shown when expanded.]() ## Properties ### Open Accordion has two visual states by default. - **Collapsed**: Only the header is shown and the Content Panel is hidden. The Chevron Icon points downward. - **Expanded**: The Content Panel is shown below the header. The Chevron Icon points upward. By default, all panels start in the Collapsed state, giving the user an overview of all content first. ![Accordion Open Property - Collapsed, Expanded]() ### Size A prop for handling both mobile and PC with a single component. Padding, font size, and Chevron Icon size differ depending on the size. The default value is Medium. - **Medium**: The default size for mobile. - **Large**: The size for PC. At the Large size, the font size stays the same even if the viewport width changes in a PC environment. Only the component's layout elements change responsively; typography uses fixed values. ![Accordion Size Property - Medium, Large]() ### Variant Defines the visual arrangement of Accordion Items. Choose the appropriate Variant depending on the nature of the content and the layout. ![Accordion Variant - Inline, Separated]() ### State The Accordion component provides Enabled, Pressed, and Disabled states. ![Accordion State - Enabled, Pressed, Enabled + Focus, Disabled]() ### Prefix The Prefix Slot is positioned on the left side of the Accordion. If you want to use an element other than an icon, use Custom to change it. Depending on what element is placed in Prefix, the spacing with the Trigger can be customized at the point of use. When adjusting spacing, use the spacing tokens provided by the design system. ![Accordion Prefix Property - None, Icon, Custom]() ## Guidelines ### Basic use of Accordion Use Accordion when you need to group related information or reduce scrolling on a long page. ![Example use case of Accordion]() ### Minimum number of Items Because Accordion is a component for navigating by collapsing and expanding multiple sections, it should be composed of at least 2 Items. For collapsing and expanding a single piece of content, you can use the Collapsible behavior on that item instead. ![Example of an Accordion composed of 2 or more Items]() ### Accordion touch area The touch area includes the entire Trigger, not just the Chevron icon. ![Example of Accordion's touch area. Includes the entire Trigger, not just the Chevron icon.]() ### Differences in Expansion Behavior | Behavior | Description | Where used | | ----------------- | -------------------------------------------------------------------------------------------------- | ---------------------------------------------- | | **Single Expand** | Only one panel can be open at a time. Opening another panel automatically closes the existing one. | Step-by-step processes, small screens or areas | | **Multi Expand** | Multiple panels can be open at the same time. Each panel's state is managed independently. | FAQs, content-rich cases | ![Example of using Single Expand]() ![Example of using Multi Expand]() ### Auto-scroll / focus movement on expansion Auto-scroll and focus movement are not supported by default. However, if the Accordion content becomes longer than the viewport, the entire Accordion should scroll vertically at the page level. ![Example of the entire Accordion scrolling vertically at the page level when expanded]() ### Avoid scrolling inside the Content Panel Avoid scrolling within an individual Content Panel. If the content is long, allow vertical scrolling at the page level that contains the entire Accordion, but do not use scrolling inside an individual panel. ![Example of vertical scrolling occurring inside a Content Panel]() ## Specification ### Accordion Component spec (JSON): /rootage/components/accordion.json ### Accordion Item Component spec (JSON): /rootage/components/accordion-item.json