eds-accordion

Explore the Interactive Component

Use the playground below to experiment with the component. Click the button to view the full Storybook deployment for additional examples and configurations.

eds-accordion Open in Storybook

See It in Use with Code

Check out this practical implementation of component.

The heading is set with the title attribute (it maps to the heading prop), and anything placed inside the element goes into the default slot as the collapsible content.

When you’re using the component directly in HTML (or in frameworks that don’t support property binding), you must pass the values like:

Slotted eds-alert

In React

In Vue

Properties

PropertyAttributeDescriptionTypeDefault
clampTextclamp-textClamps the description text when the accordion is collapsed to prevent overflowbooleantrue
descriptiondescriptionOptional description displayed below the title in the headerstringundefined
expandedexpandedDetermines if the accordion is expanded by defaultbooleanfalse
headingtitleThe title of the accordion, displayed in the header areastringundefined
iconiconOptional icon displayed in the header"copy" | "arrow-right" | "chevron-right" | "chevron-left" | "chevron-down" | "chevron-up" | "arrow-left" | "arrow-up-right" | "close" | "subtract" | "add" | "branch" | "history" | "locked" | "unlocked" | "edit" | "checkmark" | "download" | "upload" | "view" | "exit" | "caretSort" | "bookmark" | "createLink" | "activity" | "account" | "analytics" | "template" | "documentExport" | "documentDownload" | "trashCan" | "chooseItem" | "copyLink" | "dragHorizontal" | "dragVertical" | "login" | "logout" | "move" | "replicate" | "sortAscending" | "sortDescending" | "requestQuote" | "reset" | "resultDraft" | "share" | "play" | "book" | "chatOff" | "forum" | "shareKnowledge" | "time" | "help" | "customerService" | "code" | "rocket" | "compass" | "sparkle" | "menu" | "search" | "settings" | "notification" | "user" | "group" | "building" | "overflow" | "save" | "document" | "folder" | "image" | "calendar" | "information" | "warning" | "error" | "checkmark-filled" | "star" | "thumbs-up" | "thumbs-down" | "star-outline" | "thumbs-up-outline" | "thumbs-down-outline" | "twitter" | "linkedin" | "facebook" | "youtube" | "mastodon" | "bluesky" | "gitlab"undefined
switchBgswitch-bg[DEPRECATED] Use variant prop instead. Kept for backward compatibility.

booleantrue
variantvariantVisual variant: ‘default’ for dark background, ‘inverse’ for light background"default" | "inverse"'inverse'

Events

EventDescriptionType
accordionEvent emitted when the accordion toggles, indicating the new expanded/collapsed stateCustomEvent<boolean>

Dependencies

Used by

Depends on

Graph

graph TD;
  eds-accordion --> eds-icon-wrapper
  eds-kg-learning-resources --> eds-accordion
  eds-matomo-notice --> eds-accordion
  style eds-accordion fill:#f9f,stroke:#333,stroke-width:4px

Built with StencilJS