Skip to main contentCarbon Design System

Accordion

Color

ClassPropertyColor token
.bx--accordion__titlecolor$text-primary
.bx--accordion__contentcolor$text-primary
.bx--accordion__arrowfill$icon-primary
.bx--accordion__itemborder-top$border-subtle

Interactive states

ClassPropertyColor token
.bx--accordion__heading:hoverbackground$background-hover
.bx--accordion__title:focusborder$focus
.bx--accordion__title:disabledbackground$text-disabled
.bx--accordion__arrow:disabledfill$icon-disabled
.bx--accordion__item--disabledborder-top$border-disabled
accordion interactive states

Examples of enabled, hover, focus, and disabled states

Typography

All accordion titles are set in sentence case. See the accordion content guidelines for more details.

ClassFont-size (px/rem)Font-weightType token
.bx--accordion__title14 / 0.875Regular / 400$body-long-01
.bx--accordion__content14 / 0.875Regular / 400$body-long-01

Structure

There is no max-height for an open panel but an accordion may scroll if constrained by vertical space. The width of an accordion varies based on the content, layout, and page design. The icon used in the header is a chevron.

ClassPropertypx/remSpacing token
.bx--accordion__headingheight40 / 2.5–
.bx--accordion__itemborder-top1–
.bx--accordion__arrowsize16 / 1–
.bx--accordion__arrowpadding-right16 / 1$spacing-05
.bx--accordion__titlemargin-left16 / 1$spacing-05
.bx--accordion__contentpadding-right25%–
.bx--accordion__contentpadding-top8 / 0.5$spacing-03
.bx--accordion__contentpadding-left16 / 1$spacing-05
.bx--accordion__item--activepadding-bottom24 / 1.5$spacing-06
Structure and spacing measurements for accordion

Structure and spacing measurements for accordion | px / rem

Margin right

Accordions have a variable right margin that changes based on its width. Accordions that are 640px and wider have a margin-right: 25% with the percentage being based off the width of the container it is placed in. At smaller widths, the margin-right is a fixed size.

Body copy, including titles, in an accordion always follows the margin-right rules. However, inputs and other components may still expand to the full width of the accordion panel.

Accordion widthMargin-rightSpacing token
> 64025%–
420-640px64px / 4rem$spacing-10
< 42016px / 1rem$spacing-05