Icon
The Icon component renders an SVG icon, and can be extended through the icons
property in your theme.
import { Icon } from 'minerva-ui';
Usage
By default, Minerva UI includes minimal icons to keep bundle size low.
To add your own icons, you can install a library add them to your theme, or add SVGs directly:
yarn add phosphor-react # you can use most react icon libraries here
import { ThemeProvider, defaultTheme, Icon } from 'minerva-ui';import { Warning } from 'phosphor-react';const customTheme = { ...defaultTheme, icons: { // declare the key and component in your theme, then you can use the key as name in the <Icon /> component warning: Warning, },};const App = () => ( <ThemeProvider> <Icon name="warning" /> Warning! </ThemeProvider>);
Color
Size
Props
These are props related to the Icon component.
Name | Type | Is Required | Default | Description |
---|---|---|---|---|
name | string | required | none | Name of icon |
size | number or string | optional | 32px | Height and width of icon (in pixels) |
color | string | optional | #000 | Color of icon |