<Icon>
Component
Displays an emoticon or other icon to attract user's attention with built-in variants: sizes, themes, and mild.
Here the demo:
<Icon>
ComponentDisplays an emoticon or other icon to attract user's attention with built-in variants: sizes, themes, and mild.
Here the demo:
<Icon>
ComponentThere are 2 ways to install <Icon>
component into your react app project:
<Icon>
Component<Icon>
ComponentBecause <Icon>
needs to be configured first, you'll need to do: Configuring <Icon>
's Resources below:
<Icon>
's ResourcesAfter you install the <Icon>
, you need to manually copy some resources into your application public directory.
Go to /node_modules/@reusable-ui/icon/public
directory. Inside it, copy the fonts
and icons
directories into application public directory (in React: /public
). So, the final files are something like this:
/public/fonts/*.(ttf|woff|woff2)
/public/icons/*.svg
Done! The required resources by the <Icon>
component are now set! 😉
icon
PropertySelect an icon set (a string
value) corresponding to the icon image.
There are 2 types of icon sets: Built-in icon set and Custom icon set.
There a pretty much of common icon sets that ready to use for general projects.
To add custom icons, for example a logo icon, follow these steps:
The alternative appearances of the <Icon>
layout without changing the <Icon>
's functionality.
size
PropertyDefines the alternative size of the <Icon>
.
The possible values are:
undefined
'xs'
'sm'
'md'
'lg'
'xl'
'1em'
Here the preview:
theme
PropertyDefines the contextual theme of the <Icon>
.
The possible values are:
undefined
'primary'
'secondary'
'success'
'info'
'warning'
'danger'
'light'
'dark'
Here the preview:
mild
PropertyActivates a mild mode (mild color) of the <Icon>
.
The possible values are:
undefined
'inherit'
true
false
Here the preview:
Because <Icon>
is made from <Generic>
, so all properties from <Generic>
are inherited.
There are several variables of <Icon>
you can customize. Changing the variables affects all <Icon>
instance and other components that depend on <Icon>
.
Here the exposed variables:
The example of accessing, modifying, & adding variables: