React - storybook. Bootstrap Icon components don't show in storybook

Viewed 15

I am building React storybook components using react-bootstrap. Almost components are completed well. But only some components that includes bootstrap icons don't show in storybook. Is there any way to fix this issue? Thanks.

2 Answers

Sometimes the issue is for linked components, in this case, you need import each icon from SVG.

import {
  faEdit,
  faUser,
  faCartShopping,
  faHeart,
} from "@fortawesome/free-solid-svg-icons";

Don't forget link the components in console with: npm link

import "bootstrap-icons/font/bootstrap-icons.css"; in the .storybook/preview.js file solved that issue.

Related