react-bootstrap-icons is a specialized library that provides the entirety of the Bootstrap Icons collection as individual, configurable React components. Currently, on version 1.11.6, it supports Bootstrap Icons v1.13.1, offering over 2000 SVG icons for use in React applications. The library is actively maintained, with updates typically aligning with new releases of the upstream Bootstrap Icons library. Its primary differentiator is the direct conversion of each icon into a callable React component, allowing for easy integration and customization via standard React props like `color`, `size`, and `className`. It also ships with TypeScript types, enhancing developer experience by providing strong typing for icon names and component props. Unlike generic SVG icon libraries, it is exclusively focused on the Bootstrap Icons set.
npm install react-bootstrap-iconsVerified import paths — ran on the pinned version, not inferred.
Demonstrates importing and rendering multiple Bootstrap Icons components with inline props for color, size, className, and accessibility titles.
Always consult the `react-bootstrap-icons` documentation or the source code to confirm the exact `PascalCase` component name for the desired icon.
Use an alternative prop name like `iconName`, `icon`, or `filename` for the string that specifies the icon, as demonstrated in the README's dynamic icon example.
Provide a `title` prop to each icon component (e.g., `<ArrowRight title="Right Arrow" />`). This adds an `<title>` element inside the SVG, offering a short text description for screen readers.
Add `import { [IconName] } from 'react-bootstrap-icons';` to the file where the icon is used, replacing `[IconName]` with the actual icon's PascalCase name.Ensure the string used to access the icon (e.g., `icons[iconName]`) precisely matches the `PascalCase` component name. Double-check for typos or incorrect casing, especially for icons starting with numbers (e.g., `Icon1Circle`). You can `console.log(Object.keys(icons))` to verify available names.
Verify that the `iconName` string correctly resolves to an actual icon component from the `react-bootstrap-icons` library. Ensure the `import * as icons from 'react-bootstrap-icons';` statement is present and that the `iconName` property exactly matches a key within the `icons` object.