mirror of
https://github.com/alexanderschau/react-ionicons
synced 2024-12-05 01:22:02 +01:00
.devcontainer | ||
.github/workflows | ||
src | ||
.eslintrc | ||
.gitignore | ||
.prettierignore | ||
.prettierrc | ||
battery-full-outline.svg | ||
briefcase-outline.svg | ||
CODE_OF_CONDUCT.md | ||
esbuild.config.mjs | ||
hero_image.png | ||
package.json | ||
README.md | ||
run-build.sh | ||
yarn.lock |
Ionicons React Component
This package contains a React Component, which implements the latest version of the official Ionicons into React.
Installation 📦
To add the package to your existing React project just type in one of the following commands:
npm i @reacticons/ionicons
or
yarn add @reacticons/ionicons
Usage
import React from 'react';
import IonIcon from '@reacticons/ionicons';
export const Component = () => (
<>
<IonIcon name="bag-outline" />
</>
);
Custom Size
You can specify the icon size by using the optional size
prop.
<IonIcon name="bag-outline" size="small" />
<IonIcon name="bag-outline" size="large" />
Supported Icons
This package supports all Ionicons of the matching version. To see a full list of them, you can take a look at the official Ionicons website.
Hint
By the way, the <IonIcon>
Component has the same attributes as a typical <span>
element.