Garden 9 is now available.
The website has been updated to the latest major version. View previous versions
Skip to main content
Design
Components
Patterns
    • Introduction
      • Overview
    • Foundations
      • Bedrock CSS
      • Design tokens
      • Containers
      • Theming
      • Versions
    • Components
      • Accordion
      • Anchor
      • Avatar
      • Breadcrumbs
      • Buttons
      • Chrome
      • Code block
      • Color picker
      • Color swatch
      • Date picker
      • Draggable
      • Drawer
      • Forms
      • Grid
      • Loaders
      • Menu
      • Modal
      • Notification
      • Pagination
      • Pane
      • Sheet
      • Status indicator
      • Stepper
      • Table
      • Tabs
      • Tags
      • Tiles
      • Timeline
      • Tooltip
      • Tooltip dialog
      • Typography
      • Well
    Table of Contents
    • How to use it
      • Default
      • Bare
      • Expandable
      • Size
    • Configuration
    • API
      • Accordion

    Accordion

    Accordions are headers that can be expanded to reveal content or collapsed to hide it.


    Table of Contents
    • How to use it
      • Default
      • Bare
      • Expandable
      • Size
    • Configuration
    • API
      • Accordion

    Used for this
    • To organize related information into sections
    • To surface information through progressive disclosure
    Not for this
    • To guide users through a process use a Stepper instead

    How to use it

    Default

    By default, the accordion can open or collapse one section at a time.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Bare

    Section borders are removed using isBare.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Expandable

    Multiple sections can be open or closed at the same time using isExpandable.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Size

    An accordion can be default or compact.

    Toggle dark mode
    Set primary hue
    Toggle RTL
    Open in CodeSandbox
    Copy code
    View code

    Configuration

    • Name9.5.3•View source•View on npm
    • Installnpm install @zendeskgarden/react-accordions
    • Depsnpm install react react-dom styled-components @zendeskgarden/react-theming
    • Importimport { Accordion } from '@zendeskgarden/react-accordions'

    API

    The Accordion component follows this structure:

    <Accordion>  <Accordion.Section>    <Accordion.Header>      <Accordion.Label />    </Accordion.Header>    <Accordion.Panel />  </Accordion.Section>  {/* other sections */}</Accordion>

    Accordion

    Extends HTMLAttributes<HTMLDivElement>

    The Accordion component provides state and accessibility attributes to its children. It follows the W3C Accordion pattern.

    Prop nameTypeDefaultDescription
    defaultExpandedSections
    any[]

    Sets the default expanded sections in an uncontrolled accordion

    expandedSections
    any[]

    Sets the expanded sections in a controlled accordion

    isAnimated
    boolean
    true

    Animates section expansion and collapse

    isBare
    boolean

    Hides section borders

    isCollapsible
    boolean
    true

    Allows uncontrolled accordion sections to collapse

    isCompact
    boolean

    Applies compact styling

    isExpandable
    boolean

    Enables simultaneous expansion of uncontrolled accordion sections

    level
    number
    Required

    Sets aria-level heading rank in the document structure

    onChange
    ((expanded: any) => void)

    Handles accordion expansion changes

    Parameters
    value

    A section value

    Accordion.Header

    Extends HTMLAttributes<HTMLDivElement>

    A Header acts as the trigger for the corresponding Panel to be expanded or collapsed. It renders an icon to show the current expansion state. Nest it within a Section component.

    Accordion.Label

    Extends ButtonHTMLAttributes<HTMLButtonElement>

    Nest the Label within a Header component.

    Accordion.Panel

    Extends HTMLAttributes<HTMLElement>

    Nest a Panel within a Section component.

    Accordion.Section

    Extends HTMLAttributes<HTMLElement>

    Wrap each section’s Header and corresponding Panel together with the Section component.

    Garden is the design system by Zendesk.
    BlogGitHubVersions
    © Zendesk 2025