@getfly-ui/icons
v0.0.2
Published
Icons for getfly UI
Maintainers
Readme
Icons component
![]()
![]()
How to use
import { Icomoon } from '@getfly-ui/icons';OR
import { Icomoon } from 'getfly-ui';Config file json icomoon
React
import iconSet from './icomoon.json'; // icomoon new app
type IconProps = Omit<IcomoonProps, 'iconSet'>;
const Icon = ({ icon, size = 24, ...rest }: IconProps) => (
<Icomoon iconSet={iconSet} icon={icon} size={size} {...rest} />
);
React Native
import Svg, { Path, Rect, G, Defs } from 'react-native-svg';
import iconSet from './icomoon.json'; // icomoon new app
type IconProps = Omit<IcomoonProps, 'iconSet'>;
// using native components
const nativeComponents = {
path: Path,
rect: Rect,
g: G,
defs: Defs,
};
const Icon = ({ icon, size = 24, ...rest }: IconProps) => (
<Icomoon
iconSet={iconSet}
icon={icon}
size={size}
SvgComponent={Svg}
components={nativeComponents}
{...rest}
/>
);
Props
Icomoon
| Prop | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| iconSet | any | | |
| icon | string | | |
| size | number | | |
| style | CSSProperties or undefined | | |
| className | string or undefined | | |
| color | string or undefined | | |
| offset | number or undefined | | |
| currentColor | boolean or undefined | | |
| SvgComponent | JSXElementConstructor<any> or undefined | | For React Native config Svg from react-native-svg |
| components | ComponentMap or undefined | | Object config component { path: Path, g: G, rect: Rect, defs: Defs } |
