kinnu
kinnu

Reputation: 388

MDBIcon not displaying icons in React App

I am trying to use MDB React forms in my application. I have downloaded mdbreact using the command npm install --save mdbreact.

Below is the code snippet :

       <div className="text-center py-4 mt-3">
          <MDBBtn className="btn btn-outline-purple" type="submit">
            Send
            <MDBIcon far icon="paper-plane" className="ml-2" />
          </MDBBtn>
        </div>

but the icon is not displayed and MDBBtn color is not purple. Anyone, please suggest.

Upvotes: 0

Views: 5620

Answers (2)

hassan kamarzadeh
hassan kamarzadeh

Reputation: 362

  1. npm install mdbreact

  2. import { MDBIcon} from 'mdbreact';

import '@fortawesome/fontawesome-free/css/all.min.css';
import 'bootstrap-css-only/css/bootstrap.min.css';
import 'mdbreact/dist/css/mdb.css';
  1. use it: <MDBIcon icon="lightbulb" size="4x"/>

Upvotes: 0

Jasmin Moreno
Jasmin Moreno

Reputation: 11

In the documentation you have to add in index.js these importations:

import "@fortawesome/fontawesome-free/css/all.min.css";
import "bootstrap-css-only/css/bootstrap.min.css";
import "mdbreact/dist/css/mdb.css";

check the documentation about mdbreact...you find this..

Upvotes: 0

Related Questions