1.0.0 • Published 3 years ago

react-bootstrap-accordion v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

React Bootstrap Accordion

A simple react component for adding a nice vertically collapsing accordions based on bootstrap 5 Accordion.

NPM JavaScript Style Guidenpm bundle sizeGitHub

Install

npm

npm i react-bootstrap-accordion

Yarn

yarn add react-bootstrap-accordion

Usage

import React from 'react'
import { Accordion } from 'react-bootstrap-accordion'

const MyComponent = () => {
  return (
    <div className='App'>
      <Accordion /* Props */ />
    </div>
  )
}

Props

PropTypeOptionsDescriptionDefault
titleStringOptionalAccordion TitleAccordion Title
showBooleanOptionalMake accordion shown by defaultfalse
childrenReactNodeOptionalAccordion bodyLorem text

Style

The Component is based on Bootstrap 5 HTML structure and CSS classes so it will work out of the box if Bootstrap 5 css stylesheet is already included in you project. If you don't have/want to include Bootstrap, you still can use a standalone css stylesheet which was extracted form bootstrap 5 stylesheet. Just add it:

import 'react-bootstrap-accordion/dist/index.css'

Demo

Edit react-bootstrap-collapse-accordion-example

License

MIT © awran5