BASuite

BACollapse

An expandable/collapsible container component with customizable label, icon, and content area.

Basic Collapse

With Icon

Initially Expanded

Opened by default

Example:

 
import { BACollapse } from "basuite"; 
import { SettingOutlined } from "@ant-design/icons"; 

<> 
    <BACollapse label="Basic Collapse"> 
        <p>Content inside collapse</p> 
    </BACollapse> 
    <BACollapse label="With Icon" icon={<SettingOutlined />}> 
        <p>Settings content here</p> 
    </BACollapse> 
    <BACollapse label="Initially Expanded" expand> 
        <p>Opened by default</p> 
    </BACollapse> 
</> 
        

Props:

NameTypeDescriptionDefault
labelstringText displayed in the collapse header.
childrenReact.ReactNodeContent to render inside the collapse panel.
iconReact.ReactNodeOptional icon displayed before the label.
expandbooleanControls whether the collapse is initially open.false
labelClick() => voidCallback triggered when the header label is clicked.