@sidekickicons/react-native
v0.24.0
Published
Heroicons and Sidekickicons as React Native components.
Maintainers
Readme
sidekickicons-react-native
React Native package that combines Heroicons and Sidekickicons. The icons are drawn with react-native-svg, so they work on Android, iOS and the web (with react-native-web).
Browse all icons at sidekickicons.com.
Usage
First, install @sidekickicons/react-native and react-native-svg from npm:
npm install @sidekickicons/react-native react-native-svgIn an Expo app, install react-native-svg with npx expo install react-native-svg so its version matches your SDK.
Now each icon can be imported and used as a React Native component. Since there is no official React Native package for Heroicons, the @sidekickicons/react-native package includes Heroicons as well.
import { BeakerIcon, CrownIcon } from "@sidekickicons/react-native/24/solid";
import { View } from "react-native";
function MyComponent() {
return (
<View>
<CrownIcon color="#3b82f6" />
<BeakerIcon size={32} color="#22c55e" />
</View>
);
}Import the icons from their respective directory:
- 24x24 outline:
@sidekickicons/react-native/24/outline - 24x24 solid:
@sidekickicons/react-native/24/solid - 20x20 solid:
@sidekickicons/react-native/20/solid - 16x16 solid:
@sidekickicons/react-native/16/solid
Icons use an upper camel case naming convention and are always suffixed with the word Icon.
Props
size: width and height. Defaults to the icon's grid size: 24, 20 or 16.color: the icon's color. Icons draw withcurrentColor, so on the web they also inherit the surrounding text color whencolorisn't set.- Any other
Svgprop from react-native-svg, such asstyle.
Icons are hidden from screen readers. Give the button or link around an icon an accessible label.
The IconProps and IconComponent types can be imported from the package root:
import type { IconComponent } from "@sidekickicons/react-native";Building
If you want to build the library yourself, you can do so by running:
pnpm buildThis downloads the optimized SVGs from both icon repositories and generates the components.
License
MIT. Heroicons are MIT licensed by Tailwind Labs, see HEROICONS-LICENSE.
