What is @radix-ui/react-icons?
@radix-ui/react-icons is a collection of high-quality, open-source icons for React applications. It provides a set of customizable and accessible icons that can be easily integrated into any React project.
What are @radix-ui/react-icons's main functionalities?
Basic Icon Usage
This feature allows you to import and use individual icons from the @radix-ui/react-icons package. The example demonstrates how to import the CheckIcon and use it within a React component.
import { CheckIcon } from '@radix-ui/react-icons';
function App() {
return (
<div>
<CheckIcon />
</div>
);
}
Customizing Icon Size
This feature allows you to customize the size of the icons by passing width and height properties. The example shows how to set the size of the CheckIcon to 24x24 pixels.
import { CheckIcon } from '@radix-ui/react-icons';
function App() {
return (
<div>
<CheckIcon width={24} height={24} />
</div>
);
}
Styling Icons
This feature allows you to apply custom styles to the icons using the style prop. The example demonstrates how to change the color of the CheckIcon to green.
import { CheckIcon } from '@radix-ui/react-icons';
function App() {
return (
<div>
<CheckIcon style={{ color: 'green' }} />
</div>
);
}
Other packages similar to @radix-ui/react-icons
react-icons
react-icons is a popular library that provides a wide range of icons from various icon sets, including Font Awesome, Material Design, and more. It offers a larger variety of icons compared to @radix-ui/react-icons and is highly customizable.
heroicons-react
heroicons-react is a React wrapper for the Heroicons icon set. It provides a collection of beautifully designed, hand-crafted SVG icons. While it offers a different style compared to @radix-ui/react-icons, it is also easy to use and customize.
Radix Icons
A crisp set of 15×15 icons designed by the WorkOS team.
Visit icons.radix-ui.com to browse the icons.
Documentation
All icons are available as individual React components.
Install Radix Icons from npm:
npm install @radix-ui/react-icons
Import the icons into your React project:
import { FaceIcon, ImageIcon, SunIcon } from '@radix-ui/react-icons';
function MyComponent() {
return (
<div>
<FaceIcon />
<SunIcon />
<ImageIcon />
</div>
);
}
Contributing
Please follow our contributing guidelines.
Authors
License
Licensed under the MIT License, Copyright © 2022-present WorkOS.
See LICENSE for more information.