Skip to content

Accordion

<bh-accordion> | BharatAccordion

The Accordion component (bh-accordion) provides a way to organize content into collapsible sections, making it ideal for FAQs, product descriptions, or any content that benefits from progressive disclosure.

Open in flex-shrink: 0; flex-shrink: 0;

This is the content of the accordion that will be shown or hidden when clicked.

This is the content of the outline transparent accordion.

This is the content of the modern accordion.

Basic Usage

Open in flex-shrink: 0; flex-shrink: 0;

This is the content of the accordion that will be shown or hidden when clicked.

Variants

The accordion component comes with several style variants to match your design needs.

Default

The default accordion has a clean, minimal style with a light background.

Open in flex-shrink: 0; flex-shrink: 0;

This is the content of the default accordion.

Outline Transparent

Similar to outline but with transparent backgrounds.

Open in flex-shrink: 0; flex-shrink: 0;

This is the content of the outline transparent accordion.

Modern

A sleek, modern design with subtle shadows and no borders.

Open in flex-shrink: 0; flex-shrink: 0;

This is the content of the modern accordion.

Sizes

The accordion component comes in three different sizes:

Open in flex-shrink: 0; flex-shrink: 0;

This is a small accordion (30% width).

This is a half-width accordion (50% width).

This is a full-width accordion (100% width).

Accordion Groups

You can group multiple accordions together for a cohesive look and behavior.

Basic Group
Open in flex-shrink: 0; flex-shrink: 0;

Content for the first accordion.

Content for the second accordion.

Content for the third accordion.

Single Open Mode

Ensure only one accordion is open at a time within a group:

Open in flex-shrink: 0; flex-shrink: 0;

Content for the first accordion.

Content for the second accordion.

Content for the third accordion.

Advanced Features

Default Open

Make an accordion open by default:

Open in flex-shrink: 0; flex-shrink: 0;

This accordion is open by default.

Custom Icons

Change the default chevron icon using the icon-name attribute. Note - please use Bootstrap supported icon names only.

Open in flex-shrink: 0; flex-shrink: 0;

This accordion uses a plus/minus icon instead of chevron.

Real-world Examples

FAQ Section
Open in flex-shrink: 0; flex-shrink: 0;

Frequently Asked Questions

Bharat UI is a modern web component library designed for Indian websites and applications.

You can install Bharat UI via npm or use it directly via CDN.

Yes, all Bharat UI components are designed to be fully responsive across devices.

Properties

bh-accordion | BharatAccordion Properties

PropertyTypeDescription
header  string  The text displayed in the accordion header
variant  string  Style variant (default, outline, outline-transparent, modern, primary, secondary, danger, info, warning, success, gradient, tricolor)
size  string  Size of the accordion (small, half, full)
width  string  Custom width (overrides size)
border  string  Custom border style
padding  string  Custom padding
fontSize  string  Custom font size
color  string  Custom text color
iconName  string  Icon to display (requires bh-icon component)
iconSize  string  Custom icon size
groupId  string  ID for grouping accordions (set automatically when using bh-accordion-group)
isOpen  boolean    Whether the accordion is open
animated  boolean     Whether to animate transitions