13.3.0 ā€¢ Published 2 months ago

react-native-svg v13.3.0

Weekly downloads
329,474
License
MIT
Repository
github
Last release
2 months ago

react-native-svg

Version NPM

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

  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-cli

āœ… The Expo client app comes with the native code installed!

Install the JavaScript with:

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

    npm install react-native-svg

    from yarn

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

    cd ios && pod install

Supported react-native versions

react-native-svgreact-native
3.2.00.29
4.2.00.32
4.3.00.33
4.4.00.38
4.5.00.40
5.1.80.44
5.2.00.45
5.3.00.46
5.4.10.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.63.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-svgreact-native
13.0.0+0.69.0+

Troubleshooting

Problems with Proguard

When Proguard is enabled (which it is by default for Android release builds), it causes runtime error. To avoid this, add an exception to android/app/proguard-rules.pro:

-keep public class com.horcrux.svg.** {*;}

If you have build errors, then it might be caused by caching issues, please try:

watchman watch-del-all
rm -fr $TMPDIR/react-*
react-native start --reset-cache

Or,

rm -rf node_modules
yarn
react-native start --reset-cache

Unexpected behavior

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

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

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

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:

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

TODO:

  1. Filters (connected PR)

Known issues:

  1. Unable to apply focus point of RadialGradient on Android.
rn-aht-jitsi-meetsa-design-systemcupp-chartreact-native-login-drawer-templatereact-native-rn-jdenticon@ats-components/circle-sliderconsultadigital@miot-plugin/react-native-ui-kittencedchart-rnbuilders-uimiot-workspacernlineawesomeiconssquadra-native@fooxly/fooxly-transfer-iconsreact-native-simple-video-playerrealistic-uinpmreact-native-daterange-pickertenor-gif-boothreact-native-custom-components-dwsframework-reactnative-component-libexpo-shopup-uireact-native-template-workflow@thingos/thingos-native-componentslano-tech-store-mobilei-invest-wealthtekica-checkmarkssezzle-appcultgearreact-native-holper-storybookreact-native-webill-engine@bravemaster619/interview-ui@lefrankleal/react-native-bottom-tab-navigateexpo-template-nativebaseexpo-template-nativebase-typescriptolx-mallmira-test-3tinh-mirasuperlogica-banking-components@shahbaz61/searchbox-react-nativesreact-native-isw-starterreact-native-whip-ui@doggoapp/doggo-mobile-components-ts@code503/sds-react-native-componentshotqa-sdk@zerocoder/monorepo-nativelenme_component_libraryrn-draw-boardmomo-component-kitsrework-nativegep-ignition@wooyounggggg/wonder_library@widergy/utilitygo-smart-bill-mobile@zir-ai/searchbox-react-nativeairmodalnativedictionarymacmillan@youon/react-native-playerabcdeffffable-soft-component-uiubi-test-ui-rcrevoshowuijitsi-meet-rndice-uireact-native-jitsi-meet-libreact-native-circular-gauge2another-react-native-simple-calendaranna-nativeantimpackageanimated-charts-patchfirst-a-design-systemdrill_in_cardsdrill_in_cards_testki-smart-base-rnraodaor-appraodaor-app-poetryraodaor-app1rncomp@ezviz/ys-rn-pub-mini@fidme/react-native-wheel-of-fortuned-component-react-native@epsor/react-native-wagmi-charts@edgelogistics/edge-ui@eohjsc/react-native-hts@eohjsc/react-native-personal-health@eohjsc/react-native-smart-city@eohjsc/react-native-smart-parking@effinrich/ui@eliasgcf/expo-template@eliav2/react-native-collapsible-view@onejs-dev/onenativerewards-test@ettawallet/react-native-kit@ettawallet/rn-bitcoin-icons@draftbit/native@earnnest/platform-ui@vibrant-ui/core@vibrant-ui/core-native@viewstools/create-expo-appdrtyoshi-smash-native@utofun/ui
13.3.0

2 months ago

13.1.0

3 months ago

13.2.0

3 months ago

12.4.3

4 months ago

12.4.4

4 months ago

12.4.0

5 months ago

12.4.1

4 months ago

12.4.2

4 months ago

13.0.0

3 months ago

12.3.0

9 months ago

12.2.0

1 year ago

12.1.1

2 years ago

12.1.1-0

2 years ago

12.1.0

3 years ago

12.0.3

3 years ago

12.0.1

3 years ago

12.0.2

3 years ago

12.0.0

3 years ago

11.0.0

3 years ago

11.0.1

3 years ago

10.1.0

3 years ago

10.0.0

3 years ago

9.14.0

3 years ago

9.13.6

3 years ago

9.13.5

3 years ago

9.13.4

3 years ago

9.13.3

3 years ago

9.13.2

3 years ago

9.13.1

3 years ago

9.13.0

3 years ago

9.12.0

3 years ago

9.11.1

3 years ago

9.11.0

3 years ago

9.10.2

3 years ago

9.10.1

3 years ago

9.10.0

3 years ago

9.9.9

3 years ago

9.9.8

3 years ago

9.9.7

3 years ago

9.9.6

3 years ago

9.9.5

3 years ago

9.9.4

3 years ago

9.9.3

3 years ago

9.9.2

3 years ago

9.9.1

3 years ago

9.9.0

3 years ago

9.8.6

3 years ago

9.8.5

3 years ago

9.8.4

3 years ago

9.8.3

3 years ago

9.8.2

3 years ago

9.8.1

3 years ago

9.8.0

3 years ago

9.7.1

3 years ago

9.7.0

3 years ago

9.6.4

3 years ago

9.6.3

3 years ago

9.6.2

3 years ago

9.6.1

3 years ago

9.6.0

3 years ago

9.5.3

3 years ago

9.5.2

3 years ago

9.5.1

3 years ago

9.5.0

3 years ago

9.4.0

4 years ago

9.3.7

4 years ago

8.0.11

4 years ago

7.2.1

4 years ago

6.5.3

4 years ago

9.3.6

4 years ago

9.3.5

4 years ago

9.3.4

4 years ago

9.3.3

4 years ago

9.3.2

4 years ago

9.3.1

4 years ago

9.3.0

4 years ago

9.2.4

4 years ago

9.2.3

4 years ago

9.2.2

4 years ago

9.2.1

4 years ago

9.2.0

4 years ago

9.1.1

4 years ago

9.1.0

4 years ago

9.0.7

4 years ago

9.0.6

4 years ago

9.0.5

4 years ago

9.0.4

4 years ago

9.0.3

4 years ago

9.0.2

4 years ago

9.0.1

4 years ago

9.0.0

4 years ago

8.0.10

4 years ago

8.0.9

4 years ago

8.0.8

4 years ago

8.0.7

4 years ago

8.0.6

4 years ago

8.0.5

4 years ago

8.0.4

4 years ago

8.0.3

4 years ago

8.0.2

4 years ago

8.0.1

4 years ago

8.0.0

4 years ago

7.2.0

4 years ago

7.1.2

4 years ago

7.1.1

4 years ago

7.1.0

4 years ago

7.0.3

4 years ago

7.0.2

4 years ago

7.0.1

4 years ago

7.0.0

4 years ago

6.5.2

4 years ago

6.5.1

4 years ago

6.5.0

4 years ago

6.4.1

4 years ago

6.4.0

4 years ago

6.3.1

5 years ago

6.3.0

5 years ago

6.2.2

5 years ago

6.2.1

5 years ago

6.2.0

5 years ago

6.1.4

5 years ago

6.1.3

5 years ago

6.1.2

5 years ago

6.1.1

5 years ago

6.1.0

5 years ago

6.0.1-rc.3

5 years ago

6.0.1-rc.2

5 years ago

6.0.1-rc.1

5 years ago

6.0.1-rc.0

5 years ago

6.0.0

5 years ago

5.5.1

5 years ago

6.0.0-rc12

5 years ago

6.0.0-rc11

5 years ago

6.0.0-rc10

5 years ago

6.0.0-rc9

5 years ago

6.0.0-rc8

5 years ago

6.0.0-rc7

5 years ago

6.0.0-rc6

5 years ago

6.0.0-rc5

5 years ago

6.0.0-rc4

5 years ago

6.0.0-rc3

5 years ago

6.0.0-rc2

5 years ago

5.5.0

5 years ago

5.5.0-rc1

5 years ago

5.4.2

5 years ago

6.0.0-rc1

5 years ago

5.4.1

5 years ago

5.4.0

5 years ago

5.3.3

5 years ago

5.3.2

5 years ago

5.3.1

5 years ago

5.3.0

5 years ago

5.2.0

5 years ago

5.1.8

6 years ago

5.1.7

6 years ago

5.1.6

6 years ago

5.1.5

6 years ago

5.1.4

6 years ago

5.1.3

6 years ago

5.1.2

6 years ago

5.1.1

6 years ago

5.1.0

6 years ago

5.0.2

6 years ago

5.0.1

6 years ago

5.0.0

6 years ago

4.6.1

6 years ago

4.6.0

6 years ago

4.5.0

6 years ago

4.4.1

6 years ago

4.4.0

6 years ago

4.3.3

6 years ago

4.3.2

6 years ago

4.3.1

6 years ago

4.3.0

6 years ago

4.2.1

6 years ago

4.2.0

6 years ago

4.1.5

6 years ago

4.1.4

6 years ago

4.1.3

6 years ago

4.1.2

6 years ago

4.1.1

6 years ago

4.1.0

6 years ago

4.0.0

6 years ago

4.0.0-rc

6 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.0

6 years ago

3.0.0-rc

6 years ago

2.2.0

6 years ago

2.1.1

6 years ago

2.1.0

7 years ago

2.0.0

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.6

7 years ago

1.2.5

7 years ago

1.2.4

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

1.0.0-rc

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago