@s-ui/react-atom-icon
Version:
> Atom Element: Icon
44 lines (33 loc) • 1.93 kB
Markdown
# AtomIcon
> Atom Element: Icon
[](https://sui-components.vercel.app/workbench/atom/icon/)
[](https://github.com/SUI-Components/sui-components/issues/new?&projects=4&template=bug-report.yml&assignees=&template=report-a-bug.yml&title=🪲+&labels=bug,component,atom,icon)
[](https://www.npmjs.com/package/@s-ui/react-atom-icon)
[](https://github.com/SUI-Components/sui-components/issues?q=is%3Aopen+label%3Acomponent+label%3Aicon)
[](https://github.com/SUI-Components/sui-components/blob/main/components/atom/icon/LICENSE.md)
## Installation
```sh
$ npm install @s-ui/react-atom-icon --save
```
## Usage
`<AtomIcon>` wraps a `<svg>` that follows the rules defined on the UX Definition and give you some colors, sizes and interesting features like lazy-load rendering.
### Basic usage
```js
import AtomIcon, {
ATOM_ICON_COLORS,
ATOM_ICON_SIZES,
ATOM_ICON_RENDERS
} from '@s-ui/react-atom-icon'
const check = <svg viewBox="0 0 24 24">
<path d="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z" />
</svg>
return (
<>
<AtomIcon>{check}</AtomIcon>
<AtomIcon size={ATOM_ICON_SIZES.large}>{check}</AtomIcon>
<AtomIcon color={ATOM_ICON_COLORS.primary}>{check}</AtomIcon>
<AtomIcon render={ATOM_ICON_RENDERS.lazy}>{check}</AtomIcon>
</>
)
```
> **Find full description and more examples in the [demo page](https://sui-components.now.sh/workbench/atom/icon/demo).**