Skip to content

acmesquita/acmesquita-icons

Repository files navigation

Acmesquita Icons

npm

Installation

Yarn

yarn add acmesquita-icons

NPM

npm install acmesquita-icons --save

Usage

import { AcBeer } from 'acmesquita-icons/ac';

class Question extends React.Component {
    render() {
        return <h3> Lets go for a <AcBeer />? </h3>
    }
}

Configuration

You can configure react-icons props using React Context API.

Requires React 16.3 or higher.

import { IconContext } from "react-icons";

<IconContext.Provider value={{ color: "blue", className: "global-class-name" }}>
  <div>
    <FaFolder />
  </div>
</IconContext.Provider>
Key Default Notes
color undefined (inherit)
size 1em
className undefined
style undefined Can overwrite size and color
attr undefined Overwritten by other attributes
title undefined Icon description for accessibility

Global Inline Styling

<IconContext.Provider value={{ style: { verticalAlign: 'middle' } }}>

Global className Styling

Component

<IconContext.Provider value={{ className: 'react-icons' }}>

CSS

.react-icons {
  vertical-align: middle;
}

TypeScript native support

Dependencies on @types/react-icons can be deleted.

Yarn

yarn remove @types/react-icons

NPM

npm remove @types/react-icons

Development

yarn
yarn submodule  # fetch icon sources
cd packages/react-icons
yarn build

Preview

The preview site is the react-icons website, built in NextJS.

cd packages/react-icons
yarn build

cd ../preview
yarn start

Why React SVG components instead of fonts?

SVG is supported by all major browsers. With react-icons, you can serve only the needed icons instead of one big font file to the users, helping you to recognize which icons are used in your project.

Related Projects

Licence

MIT

  • Icons are taken from the other projects so please check each project licences accordingly.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published