Collapse
Wrapper for the Bootstrap collapse component.
Example Usage
import React from "react";
import {Collapse} from "bs5-react-elements";
function ExampleUsage() {
return <>
<button
data-bs-toggle="collapse"
data-bs-target="#example-usage"
aria-expanded="false"
aria-controls="example-usage"
>
Toggle
</button>
<Collapse id="example-usage" className="collapse">
Lorem ipsum dolor.
</Collapse>
</>;
}
Important! Bootstrap 5.0.x users, if you wish to configure your collapse, you must use the config
prop, as
data attributes are not supported in this version. This bug is
fixed in later versions of boostrap (5.1.x, 5.2.x, etc).
Demos
There are no demos available for this element. Submit an issue or pull request on GitHub to add one.
Props
Name | Description | Type | Default Value | Since |
---|---|---|---|---|
onShown | Handler for the shown.bs.collapse event | func | 0.2.0 | |
onShow | Handler for the show.bs.collapse event | func | 0.2.0 | |
onHidden | Handler for the hidden.bs.collapse event | func | 0.2.0 | |
onHide | Handler for the hide.bs.collapse event | func | 0.2.0 | |
component | React ref that will be assigned the component instance | React ref | 0.2.0 | |
config | Component configuration | object | 0.2.0 | |
children | Collapse contents | node | 0.2.0 |