Iconography
Icons are essential visual elements in the Akinon UI Kit that help users quickly understand actions, navigate interfaces, and identify content types.
This guide covers the @akinon/icons package and best practices for using icons in your application.
Overview
The Akinon UI Kit provides a comprehensive icon system through the @akinon/icons package:
React Components – SVG-based icons as React components for optimal performance
Type Safety – Full TypeScript support with autocomplete for icon names
Customizable – Size, color, and style can be adjusted through props
Accessible – Support for titles and ARIA attributes
Tree-shakeable – Only the icons you use are included in your bundle
Installation
Install the icons package:
pnpm install @akinon/iconsBasic Usage
Import the Icon component and use it with the icon prop:
Icon Component
The Icon component is the primary way to render icons. It accepts various props for customization.
Props
icon
IconName
-
Required. Name of the icon to render.
size
number | string
24
Size of the icon in pixels or CSS value.
color
string
'currentColor'
Color of the icon. Inherits text color by default.
title
string
-
Accessible title for screen readers.
disableFill
boolean
false
Disables the fill color of the icon.
removeInlineStyle
boolean
false
Removes all inline styles from the SVG.
style
CSSProperties
-
Additional inline styles.
SvgComponent
JSXElementConstructor
-
Custom component to replace <svg> element.
PathComponent
JSXElementConstructor
-
Custom component to replace <path> elements.
The component also accepts all standard SVG element props.
Examples
Size Variations
Color Customization
Accessibility
Always provide accessible labels for icons that convey meaning:
Icon with Button
Use the Button component with the icon prop for buttons with icons:
Available Icons
The @akinon/icons package includes over 100 icons for various use cases including navigation, actions, status indicators, e-commerce, communication, and more.
To browse all available icons with live previews and copy functionality, visit the Storybook Icon Gallery.
You can also retrieve the icon list programmatically:
TypeScript Support
The icon prop is fully typed with autocomplete support:
Best Practices
1. Use Semantic Icons
Choose icons that clearly represent their action or meaning:
2. Use Button Component for Interactive Icons
Always use the Button component for interactive icons:
3. Maintain Consistent Sizing
Use consistent icon sizes throughout your application:
4. Leverage Color Inheritance
Let icons inherit text color when appropriate:
5. Use Utility Classes for Layout
Position icons using utility classes, not inline styles:
Troubleshooting
Icon Not Rendering
Verify the icon name exists:
Check for typos in the icon name (TypeScript will help catch these)
Ensure the package is installed:
Icon Color Not Changing
The color prop might be overridden. Check:
Parent element styles
CSS specificity issues
Use
removeInlineStyleprop and apply color via CSS class if needed
Icon Size Issues
Related Documentation
Last updated
Was this helpful?

