RichIcon
A rich icon component is used to render a rich custom icon.
Similar to icons, RichIcons are vibrant and colorful. Perfect for decorative purposes or drawing attention to specific elements.
Hopper provides multiple ways to use rich icons in your project:
- Using the Workleap icon library
- Creating your own icons
Creating your custom rich icons
To use an rich icon component to create custom rich icons you must first import your SVG icon as a component by using @svgr/webpack
.
Hopper provides two methods for creating your custom icons:
- Using the
createRichIcon
function (recommended) - Using the
RichIcon
component
Both RichIcon
and createRichIcon
enable you to style the icon using the styled system.
Using the createRichIcon function
The createRichIcon
function is a convenience wrapper around the process of generating rich icons with RichIcon
, allowing you to achieve the same functionality with less effort.
Using the RichIcon component
Sizes
A rich icon can vary in size. When used inside another component, it'll generally be sized automatically. If you use a standalone icon, you can use the size prop to control the sizing.
Styling
The color of the rich icon can be changed using the fill
prop. All the styled system props are also available.
Variants
The color of the rich icon can be changed using the variant
prop.
Props
The visual style of the icon.
The size of the icon.
The source of the icon with a size of 24px.
The source of the icon with a size of 32px.
The source of the icon with a size of 40px.