Svg Reference

How to render an SVG?

To render a SVG, you can:

Options

Optimization

The svg are optimized with the svgo preset

Import

On file import, the SVG are transformed as React Component with SvgR

Example:

  • With the below import statement, OpenAiIcon is a React component optimized
jsx
import OpenAiIcon from "bootstrap-icons/icons/openai.svg" export default function MyIcon() { return <OpenAiIcon width={24}/> }
  • or from a file
jsx
import Arrow from "./arrow-right-circle.svg" export default function svgPage() { return ( <Arrow width={10}/> ) }