React Native

@devigner-ui/icons-react-native: every icon as a React Native component, drawn with react-native-svg. Works in Expo and bare React Native.

Install

Terminal
npm install @devigner-ui/icons-react-native react-native-svg

react-native-svg is a peer dependency: every shape is one of its components. In Expo, install it with npx expo install react-native-svg.

Import

Metro does not tree-shake, so importing from the package root pulls the whole set into your bundle. Import each icon from its own path:

TSX
import IconShoppingCart from "@devigner-ui/icons-react-native/icons/ShoppingCart";

The root import works too, at that cost:

TSX
import { IconShoppingCart } from "@devigner-ui/icons-react-native";

Use

TSX
<IconShoppingCart size={24} color="#16161a" />
<IconShoppingCart variant="bulk" size={32} color="#6d5cf5" />

Props

Prop Type Default What it does
variant "outline" | "twotone" | "bold" | "bulk" | "broken" "outline" Which drawing to render
size number | string 24 Width and height, in points
color string What currentColor resolves to
strokeWidth number | string 1.5 Line weight of outline, twotone and broken

Everything else reaches the <Svg>: style, onPress, testID and the accessibility props.

React Native has no CSS cascade, so color is the colour a web icon would have inherited from its parent. A few drawings are 25×24 rather than square; size sets both sides and the drawing letterboxes inside them.

Accessibility

An icon is hidden from accessibility services by default, because an icon beside its own label would be announced twice. Name it and it becomes an image:

TSX
<IconShoppingCart accessibilityLabel="Cart" />

Documentation

Browse all 12,480 icons