@breeffy/icons
Component to show FontAwesome icons.
Features
- Duotone icons support
- FontAwesome v6 support
- TypeScript support
- Compatible with styled-components
- Compatible with styled-components css property
Peer Dependencies
"peerDependencies": {
"react": "*",
"react-native": "*",
"react-native-svg": "*"
}
See this section about peer dependencies and how to get correct versions.
Installation
# Install react-native-svg peer dependency
$ yarn add react-native-svg
# Install @breeffy/icons package
$ yarn add @breeffy/icons
# Install FontAwesome icon packs
$ yarn add @fortawesome/free-solid-svg-icons
Configuration
Add required icons or styles into library
import { library } from '@fortawesome/fontawesome-svg-core';
import { fas } from '@fortawesome/free-solid-svg-icons';
library.add(fas);
Usage
import { Icon } from '@breeffy/icons';
import type { IconProps } from '@breeffy/icons';
export const Icon = () => {
return <Icon icon={['far', 'address-book']} />;
};
See storybook for use case examples. Also see react-native-fontawesome documentation, most of it is still valid.