Getting StartedInstallationSupportChangelogGithubFrameworksAngularVueReactDemosFoundationThemesInternationalizationTypographyIconsLayoutGetting StartedBlockInlineGridComponentsAccordionAlertAlert GroupBadgeBreadcrumbButtonButton GroupButton ExpandButton HandleButton IconButton Icon GroupButton SortCardCheckboxColorData GridDateDialogDividerDrawerDropdownFileFormsForm InteractionsForm ValidationHeaderInputMenuMonthNavPaginationPasswordProgress BarProgress CircleRadioRangeSearchSelectShellSwitchTabsTagTextareaTimeToastTooltipData GridGetting StartedFooterPlaceholderAsyncResponsiveScroll HeightPaginationBordersHoverColumn AlignmentColumn WidthColumn FixedColumn StickyColumn VisibilityRow HeaderRow Multi SelectRow Single SelectRow HeightRow ActionRow Action BulkRow StickyRow StripeRow FixedRow SortRow Groups

Usage

The accordion component is used to display a large amount of content in a small space. The accordion should be used to group related content together. The titles or headings of the accordion sections should be clear and concise, describing the content that will be revealed.

Example

Expanded accordion panel

Expanded accordion content

Disabled accordion header

Disabled accordion content

Collapsed accordion

Collapsed accordion content

code
<script type="module">
import '@blueprintui/components/include/accordion.js';
</script>

<bp-accordion>
<bp-accordion-panel expanded>
<bp-accordion-header>Expanded accordion panel</bp-accordion-header>
<bp-accordion-content>
<p bp-text="content">Expanded accordion content</p>
</bp-accordion-content>
</bp-accordion-panel>
<bp-accordion-panel>
<bp-accordion-header disabled>Disabled accordion header</bp-accordion-header>
<bp-accordion-content>
<p bp-text="content">Disabled accordion content</p>
</bp-accordion-content>
</bp-accordion-panel>
<bp-accordion-panel>
<bp-accordion-header>Collapsed accordion</bp-accordion-header>
<bp-accordion-content>
<p bp-text="content">Collapsed accordion content</p>
</bp-accordion-content>
</bp-accordion-panel>
</bp-accordion>

Install

NPM

// npm package
import '@blueprintui/components/include/accordion.js';

CDN

<script type="module">
import 'https://cdn.jsdelivr.net/npm/@blueprintui/components/include/accordion.js/+esm';
</script>

Accessibility

  • Use clear, descriptive titles or headings for the accordion sections.
  • Ensure keyboard navigation order is not disrupted.
  • Provide an alternative way for users to access the content in the accordion sections, such as a "show all" or "expand all" button.

bp-accordion

Properties

NameTypesDescription

CSS Properties

NameTypesDescription
--border-color
--border-width
--border-radius

Slots

NameTypesDescription
defaultslot for accordion panels

bp-accordion-panel

Properties

NameTypesDescription
expandedboolean

Attributes

NameTypesDescription
expandedboolean

Slots

NameTypesDescription
defaultslot for header and content
bp-accordion-header
bp-accordion-content

bp-accordion-header

Properties

NameTypesDescription
pressedboolean
readonlyboolean
disabledboolean
type'button' | 'submit'
namestring
valuestring
formHTMLFormElement
formActionstring
formEnctypestring
formMethodstring
formNoValidateboolean
formTargetstring
labelsNodeListOf
validationMessagestring
validityValidityState
willValidateboolean
checkValidityany
reportValidityany
setCustomValidityany
formAssociatedboolean

Attributes

NameTypesDescription
pressedboolean
expandedboolean
readonlyboolean
disabledboolean
type'button' | 'submit'
namestring
valuestring

CSS Properties

NameTypesDescription
--background
--color
--font-size
--padding

Slots

NameTypesDescription
defaultslot for header content

bp-accordion-content

Properties

NameTypesDescription

CSS Properties

NameTypesDescription
--color
--font-size
--font-weight
--background

Slots

NameTypesDescription
defaultslot for content