How to use react-bootstrap-icons ?

sandeep negi
Jul 21, 2021
  1. install react-bootstrap-icons dependency
npm i react-bootstrap-icons

2. Navigate to the website : https://icons.getbootstrap.com/#usage

to see all the icons that we can use

3. Let say we wants to use the icon called as trash

so lets see how we can use this in our component

  • here we have imported the icon that we need like “trash”
  • and then we added it as a componentt
  • we can give any color , size and we can send it as a prop in the component.
import React from ‘react’import { Trash } from ‘react-bootstrap-icons’import { PencilSquare } from ‘react-bootstrap-icons’function milestone() {return (<div><PencilSquare size={35} /><Trash size={35} /></div>)}export default milestone

--

--

sandeep negi

Software Engineer, who loves challenges and new technologies. :)