Skip to main content
Neighborhood Design System v5.1.0

Accordion

Draft

Accordion organizes collapsible Accordion Item components, providing consistent layout, styling, and accessibility for grouped expandable content.

Draft. This component is in draft. Its API may change before it is marked Ready. What this means

Preview

Open in Storybook (opens in new tab)

Code

Install
npm install @fbin-web/neighborhood-core
Import
import { NbhdAccordion } from '@fbin-web/neighborhood-core';
Usage
<nbhd-accordion>
  <nbhd-accordion-item header="Accordion Item 1">
    <nbhd-text> This is the content for accordion item 1. </nbhd-text>
  </nbhd-accordion-item>

  <nbhd-accordion-item header="Accordion Item 2">
    <nbhd-text> This is the content for accordion item 2. </nbhd-text>
  </nbhd-accordion-item>

  <nbhd-accordion-item header="Accordion Item 3">
    <nbhd-text> This is the content for accordion item 3. </nbhd-text>
  </nbhd-accordion-item>
</nbhd-accordion>

Usage

  • Only accepts Accordion Item children.

Properties

PropertyAttributeTypeDefaultDescription
allowMultipleallow-multiplebooleanfalseAllow multiple accordion items to be open at the same time.

Slots

NameDescription
(default)The default slot for accordion items.

CSS Properties

Set these on nbhd-accordion or an ancestor to override the defaults. Token is the design token a default comes from and Value is what it resolves to in core Neighborhood; brands may override them. Properties that adapt to surface follow the light or inverse surface they sit on until you set them.

PropertyTokenValue Copy
--nbhd-accordion-item-borderBlockEndColor--nbhd-context-color-control-borderAdapts to surface
--nbhd-accordion-item-borderBlockEndStyle—solid
--nbhd-accordion-item-borderBlockEndWidth--nbhd-border-width-subtle1px

Dependencies

Child components <nbhd-accordion> renders internally. Import them too when you tree-shake.

Esc
↑ ↓ to move↵ to open