React Bootstrap Collapse Component
Collapse with Bootstrap Styling

Bootstrap 5 components designed for React.js
This component is part of the CoreUI for React.js UI components library, which offers all Bootstrap components designed to work seamlessly with React.js.
If you want to use Bootstrap 5 in a React.js environment while also needing advanced components that Bootstrap does not offer and dedicated developer support, then this library is the best solution for you.
Learn how to use the React Bootstrap Collapse component from CoreUI to toggle visibility of content panels using animations and Bootstrap-compatible transitions.
How the React Bootstrap Collapse component works#
The React Bootstrap Collapse component allows you to toggle the visibility of content using animated height or width transitions. It’s perfect for creating expandable sections, FAQs, and collapsible panels with clean and accessible markup.
Triggers such as buttons or anchor elements are connected to collapsible targets. The collapse animation modifies the height
or width
property, so padding should not be applied directly to the .collapse
element.
React Bootstrap Collapse example#
You can trigger collapsible content using a button or a link. Below is a simple example using CoreUI components styled with Bootstrap.
Horizontal React Bootstrap Collapse#
Use the horizontal
prop on the React Bootstrap Collapse component to transition the width
instead of height
. Don’t forget to apply a specific width to the immediate child of the collapse element.
Multiple collapse targets#
React Bootstrap Collapse supports multiple targets toggled by a single trigger. Use a <CButton>
to show or hide more than one collapsible element at the same time.
API reference#
Check the API documentation below to explore all available props for the React Bootstrap Collapse component: