Import
Description
TheSimpleIcon component is a wrapper for @icons-pack/react-simple-icons, providing access to thousands of popular brand icons including social media platforms, programming languages, frameworks, and more.
Library
- Package:
@icons-pack/[email protected] - Default Tag:
SiReact
Usage
Props
The icon component name from Simple Icons. This is the first positional argument to the
create() method.Icon names follow the pattern Si{BrandName} (e.g., “SiReact”, “SiGithub”, “SiPython”).This prop sets the component’s tag, which determines which icon is imported from the library.The color of the icon. Accepts any valid CSS color value:
- Hex:
"#FF0000" - RGB:
"rgb(255, 0, 0)" - Named:
"red" - CSS variables:
"var(--accent-9)"
The size of the icon. Can be specified as:
- Integer: pixel value (e.g.,
24for 24px) - String: any valid CSS size unit (e.g.,
"2em","1.5rem","24px")
Special Behavior
create() Method
TheSimpleIcon.create() method (also available as simple_icon()) requires the icon name as the first positional argument:
Dynamic Icon Imports
The component dynamically imports the specific icon from the library using theadd_imports() method. This means:
- Each icon is imported individually
- Only the icons you use are included in your bundle
- The tag is set to the provided
icon_name
Icon Names
Icon names follow the Simple Icons naming convention with theSi prefix:
- React:
SiReact - GitHub:
SiGithub - Python:
SiPython - JavaScript:
SiJavascript - TypeScript:
SiTypescript - Docker:
SiDocker - AWS:
SiAmazon
Si in PascalCase.