DocsIcons

Icons

The UI Kit is designed to work seamlessly with popular icon libraries like Phosphor Icons, Font Awesome or Material Icons. These libraries follow the recommended conventions—using currentColor for fill and 1em for size—ensuring icons inherit color and scale properly when used within UI Kit components.

If you’re using custom SVG icons, make sure they follow the same conventions and are converted to React components.

To easily convert .svg files to React components, use SVGR and vite-plugin-svgr.

Given a <CustomIcon /> SVG React component, usage would look like this:

<HvButton startIcon={<CustomIcon />} />
<HvInput endAdornment={<CustomIcon />} />
<HvCardHeader icon={<CustomIcon />} />

HvIconContainer

Icons are often used independently from other components. To support this, the UI Kit provides the HvIconContainer utility component, which ensures icons are styled according to the design specifications.

HvIconContainer enhances icon usage by adding support for HvColor and applying consistent padding through a “container box” based on the icon size. This helps maintain visual alignment and spacing across your UI.

For detailed usage and examples, see the HvIconContainer documentation.

Title