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.

NameTypeIs RequiredDefaultDescription
namestringrequirednoneName of icon
sizenumber or stringoptional32pxHeight and width of icon (in pixels)
colorstringoptional#000Color of icon