Stateless React components for Bootstrap 5. A maintained fork of reactstrap (v9), published to GitHub Packages.
# .npmrc
@conventioncatcorp:registry=https://npm.pkg.github.comreactstrap 10 targets React 19+ and Bootstrap 5 and ships as ESM with bundled TypeScript types.
npm create vite@latest my-app -- --template react-ts
cd my-app
npm i @conventioncatcorp/reactstrap bootstrapImport Bootstrap CSS once (e.g. src/main.tsx):
import 'bootstrap/dist/css/bootstrap.css';Then use components:
import { Button } from '@conventioncatcorp/reactstrap';Upgrading from 9.x? See v10-migration.md.
These libraries are not bundled with Reactstrap and required at runtime:
This library contains React Bootstrap components that favor composition and control. The library does not depend on jQuery or Bootstrap javascript. However, Popper (@popperjs/core) is relied upon for advanced positioning of content like Tooltips, Popovers, and auto-flipping Dropdowns.
There are a few core concepts to understand in order to make the most out of this library.
-
Your content is expected to be composed via props.children rather than using named props to pass in Components.
// Content passed in via props const Example = (props) => { return ( <p> This is a tooltip{' '} <TooltipTrigger tooltip={TooltipContent}>example</TooltipTrigger>! </p> ); }; // Content passed in as children (Preferred) const PreferredExample = (props) => { return ( <p> This is a{' '} <a href="#" id="TooltipExample"> tooltip </a>{' '} example. <Tooltip target="TooltipExample"> <TooltipContent /> </Tooltip> </p> ); };
-
Attributes in this library are used to pass in state, conveniently apply modifier classes, enable advanced functionality (like tether), or automatically include non-content based elements.
Examples:
isOpen- current state for items like dropdown, popover, tooltiptoggle- callback for togglingisOpenin the controlling componentcolor- applies color classes, ex:<Button color="danger"/>size- for controlling size classes. ex:<Button size="sm"/>tag- customize component output by passing in an element name or Component- boolean based props (attributes) when possible for alternative style classes or
visually-hiddencontent
Storybook docs are deployed to this repo's GitHub Pages by .github/workflows/docs.yml (npm start locally).
Upstream v9 docs: https://reactstrap.github.io
Requires Node 26 (nvm use) and npm.
npm ci # install
npm start # Storybook docs at http://localhost:8080/
npm test # Vitest watch
npm run cover # tests + coverage
npm run lint # oxlint
npm run typecheck # tsc
npm run build # dist/ (Vite lib build + tsc declarations)Published from a local machine to GitHub Packages (.npmrc maps the @conventioncatcorp scope; your ~/.npmrc needs
a token with write:packages for //npm.pkg.github.com/):
npm version <major|minor|patch> # bumps package.json, commits and tags
npm publish # prepublishOnly runs typecheck, lint, tests and build
git push --follow-tagsStorybook docs deploy to GitHub Pages on every push to master.
Organizations and projects using reactstrap
- airframe-react - demo - Airframe provides all the components a developer needs to build data-intensive web apps using React.
- component-template
- video-react
- CoreUI-Free-Bootstrap-Admin-Template - demo
- Admin dashboard example app built with reactstrap - demo
- DevExtreme React Grid - It's a stateless data grid built on top of
reactstrapwith paging, sorting, filtering, grouping, selection, editing and virtual scrolling features. - DevExtreme React Chart - A chart built on top of
reactstrapthat visualizes data using a variety of series types, including bar, line, area, scatter, pie, and more. - reactstrap-scrollspy - demo
- formstrap - demo - Let your
reactstrapinput component integrate seamlessly usingFormik - Jimu UI - demo - The UI library for ArcGIS Experience Builder mapping platform.
Submit a PR to add to this list!
Looking to build, document and publish reusable components built on top of reactstrap? Consider forking https://github.com/reactstrap/component-template to kickstart your project!
