Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

react-native-svg

> 编程语言
Open source

SVG library for React Native, React Native Web, and plain React web projects.

8.0K stars0 likes2 views
WebsiteGitHub

About

SVG library for React Native, React Native Web, and plain React web projects.

`react-native-svg` provides SVG support to React Native on iOS, Android, macOS, Windows, and a compatibility layer for the web.

Check out the Example app

  • Features
  • Installation
  • Troubleshooting
  • Opening issues
  • Usage
  • Known issues

Features

  1. Supports most SVG elements and properties (Rect, Circle, Line, Polyline, Polygon, G ...).
  2. Easy to convert SVG code to react-native-svg.

Installation

With expo

✅ The Expo client app comes with the native code installed!

Install the JavaScript with:

bash
npx expo install react-native-svg

See the Expo docs for more info or jump ahead to Usage.

With react-native-cli

  1. Install library

    from npm

    bash
    npm install react-native-svg

    from yarn

    bash
    yarn add react-native-svg
  2. Link native code

    bash
    cd ios && pod install

Supported react-native versions

react-native-svg react-native
3.2.0 0.29
4.2.0 0.32
4.3.0 0.33
4.4.0 0.38
4.5.0 0.40
5.1.8 0.44
5.2.0 0.45
5.3.0 0.46
5.4.1 0.47
5.5.1 >=0.50
>=6 >=0.50
>=7 >=0.57.4
>=8 >=0.57.4
>=9 >=0.57.4
>=12.3.0 >=0.64.0
>=15.0.0 >=0.70.0
>=15.8.0 >=0.73.0
>=15.13.0 >=0.78.0

Support for Fabric

Fabric is React Native's new rendering system. As of version 13.0.0 of this project, Fabric is supported only for react-native 0.69.0+. Support for earlier versions is not possible due to breaking changes in configuration.

react-native-svg react-native
>=13.0.0 0.69.0+
>=13.6.0 0.70.0+
>=13.10.0 0.72.0+

Troubleshooting

Unexpected behavior

If you have unexpected behavior, please create a clean project with the latest versions of react-native and react-native-svg

bash
react-native init CleanProject
cd CleanProject/
yarn add react-native-svg
cd ios && pod install && cd ..

Make a reproduction of the problem in App.js

bash
react-native run-ios
react-native run-android

Adding Windows support

  1. npx react-native-windows-init --overwrite
  2. react-native run-windows

Opening issues

Verify that it is still an issue with the latest version as specified in the previous step. If so, open a new issue, include the entire App.js file, specify what platforms you've tested, and the results of running this command:

bash
react-native info

If you suspect that you've found a spec conformance bug, then you can test using your component in a react-native-web project by forking this codesandbox, to see how different browsers render the same content: https://codesandbox.io/s/pypn6mn3y7 If any evergreen browser with significant userbase or other svg user agent renders some svg content better, or supports more of the svg and related specs, please open an issue asap.

Usage

To check how to use the library, see USAGE.md

Known issues:

  1. Unable to apply focus point of RadialGradient on Android.

React Native SVG is maintained by Software Mansion

Since 2012 Software Mansion is a software agency with experience in building web and mobile apps. We are Core React Native Contributors and experts in dealing with all kinds of React Native issues. We can help you build your next dream product – Hire us.

Issues· 267 open

View all issuesOpen on GitHub
  • #3015

    RN 0.87 compatibility - Metro fails to resolve `@react-native/assets-registry/registry` when importing from `react-native-svg/css`

    Repro providedUpdated Sep 22, 2026
  • #2854

    NSInvalidArgumentException when LinearGradient's parseReference is called on iOS

    Missing reproUpdated Sep 3, 2026
  • #2974

    font-family fallback not honored when first font in family not available (Android & iOS)

    Repro providedUpdated Aug 22, 2026
  • #3006

    Fabric/iOS: strokeDasharray cannot be cleared on a recycled view (missing else in RNSVGFabricConversions.h)

    Missing infoRepro providedUpdated Jul 29, 2026
  • #2994

    "instanceHandle is null, event of type topSvgLayout will be dropped" logged repeatedly when SVG components are rapidly recycled in a FlatList

    Repro providedUpdated Jul 10, 2026
  • #2878

    EXC_BAD_ACCESS: Fatal topSvgLayout > KERN_INVALID_ADDRESS

    Missing reproMissing infoUpdated Jul 9, 2026
  • #2990

    [Windows] App crash (use-after-free) in DirectXDeviceManager::DiscardDeviceResources — raw Release() on com_ptr-owned D2D device/context

    Missing reproUpdated Jul 1, 2026
  • #2962

    iOS Fabric: useAnimatedProps({ color }) on <Svg> doesn't repaint per frame — only final value lands

    Missing reproUpdated Jun 29, 2026
  • #2976

    Generic Family fonts ignored on iOS

    Repro providedUpdated Jun 9, 2026
  • #1386

    `patternTransform` does not render properly on iOS

    bugUpdated Jun 4, 2026

> Tags

TypeScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedOct 1, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言