React Native
Use AXIcons in React Native with react-native-svg: props, colour and native styling.
Install
Requires react ^19.3.1 and react-native >=0.78.
pnpm add @axcore/xicons-react-native react-native-svgUsage
Same names as the web package. Icons render through react-native-svg.
import { IconCamera, IconHeartFilled } from "@axcore/xicons-react-native";
import { View } from "react-native";
export function Toolbar() {
return (
<View style={{ flexDirection: "row", gap: 16 }}>
<IconCamera size={24} color="#18181b" />
<IconHeartFilled size={24} color="#e11d48" />
</View>
);
}Props
Icons accept every react-native-svg SvgProps prop.
| Prop | Type | Default | What it does |
|---|---|---|---|
size | number | string | 24 | Width and height in density-independent pixels. |
color | string | none | Sets currentColor for both stroke and fill icons. |
strokeWidth | number | 1.75 | Stroke weight of outline icons. |
Differences from the web
- There is no CSS cascade: pass
coloron each icon. - There is no
classNameprop. With NativeWind, size a wrappingView. - There is no
titleprop; label the pressable wrapper withaccessibilityLabel.
<Pressable accessibilityRole="button" accessibilityLabel="Take photo">
<IconCamera size={24} color="#18181b" />
</Pressable>Troubleshooting
- “requireNativeComponent: RNSVG… was not found”:
react-native-svgis not linked. Install it in the app and rebuild the native project. - The icon renders black: pass
color. Native SVG has no inherited text colour.
Something wrong or missing?Open an issue