Abdo Rabah
Abdo Rabah

Reputation: 2072

Add a SVG image as an icon in Button (react-bootstrap)?

I want to get the result like shown in the image below. I'm using Button from react-bootstrap.

<Button size="lg" className={`${styles.premium} w-100 mt-5 mb-3`}>
  Abonnement Premium
</Button>

How can i add a SVG image to a Button as an icon in React?

Result desired

Upvotes: 0

Views: 6136

Answers (1)

Keaton Benning
Keaton Benning

Reputation: 623

import the image import yourImg from '../to/your/image.svg';

Just add it in front of the words

<Button size="lg" className={`${styles.premium} w-100 mt-5 mb-3`}>
  <img src={yourImg} /> Abonnement Premium
</Button>

Upvotes: 4

Related Questions