{"_id":"@boomsi/react-native-svg","name":"@boomsi/react-native-svg","dist-tags":{"latest":"15.15.5"},"versions":{"15.15.5":{"version":"15.15.5","name":"@boomsi/react-native-svg","description":"SVG library for react-native — fork of react-native-svg with Windows Fabric text rendering fixes","homepage":"https://github.com/boomsi/react-native-svg#readme","repository":{"type":"git","url":"git+https://github.com/boomsi/react-native-svg.git"},"license":"MIT","main":"lib/commonjs/index.js","module":"lib/module/index.js","types":"lib/typescript/index.d.ts","react-native":"src/index.ts","react-native-builder-bob":{"source":"src","output":"lib","targets":["commonjs","module",["typescript",{"project":"tsconfig.build.json"}]]},"keywords":["react-component","react-native","ios","android","windows","SVG","ART","VML","gradient"],"scripts":{"bob":"bob build","format":"yarn format-js && yarn format-ios && yarn format-java","format-ios":"find apple/ common/ -iname *.h -o -iname *.m -o -iname *.cpp -o -iname *.mm | xargs clang-format -i","format-java":"node ./scripts/format-java.js","format-js":"prettier --write README.md CONTRIBUTING.md CODE_OF_CONDUCT.md USAGE.md ./src/**/*.{ts,tsx} ./apps/**/*.{ts,tsx}","jest":"jest","lint":"eslint --ext .ts,.tsx src","peg":"pegjs -o src/lib/extract/transform.js ./src/lib/extract/transform.peg && peggy -o src/filter-image/extract/extractFiltersString.js src/filter-image/extract/extractFiltersString.pegjs && peggy -o src/lib/extract/transformToRn.js src/lib/extract/transformToRn.pegjs","prepare":"npm run bob","test":"npm run lint && npm run tsc","tsc":"tsc --noEmit","e2e":"jest e2e","generateE2eReferences":"ts-node e2e/generateReferences.ts","check-archs-consistency":"node ./scripts/codegen-check-consistency.js","sync-archs":"node ./scripts/codegen-sync-archs.js","metal-to-ci":"node ./scripts/metal.js"},"peerDependencies":{"react":"*","react-native":"*"},"dependencies":{"css-select":"^5.1.0","css-tree":"^1.1.3"},"devDependencies":{"@babel/core":"^7.25.2","@babel/preset-env":"^7.25.3","@react-native/babel-preset":"^0.77.0","@react-native/eslint-config":"^0.77.0","@types/css-tree":"^1.0.3","@types/jest":"^28.1.0","@types/node":"*","@types/pixelmatch":"^5.2.0","@types/pngjs":"^6.0.5","@types/react":"^18.3.12","@types/react-test-renderer":"^18.2.0","@types/ws":"^8.5.13","@typescript-eslint/eslint-plugin":"^5.11.0","@typescript-eslint/parser":"^5.11.0","babel-plugin-module-resolver":"^5.0.0","clang-format":"^1.8.0","eslint":"^8.44.0","eslint-config-prettier":"^8.3.0","eslint-config-standard":"^17.0.0","eslint-import-resolver-babel-module":"^5.3.2","eslint-plugin-import":"^2.25.4","eslint-plugin-n":"^16.0.0","eslint-plugin-promise":"^6.1.1","eslint-plugin-react-hooks":"^4.6.0","eslint-plugin-standard":"^5.0.0","husky":"^8.0.1","jest":"^28.1.0","jest-html-reporters":"^3.1.7","lint-staged":"^13.0.3","peggy":"4.0.3","pegjs":"^0.10.0","pixelmatch":"5.3.0","pngjs":"^7.0.0","prettier":"3.0.1","puppeteer":"^22.12.1","react":"^18.3.1","react-native":"^0.77.0","react-native-builder-bob":"^0.22.0","react-native-windows":"^0.77.0","react-test-renderer":"^18.2.0","ts-node":"^10.9.2","typescript":"^5.1.6","ws":"^8.18.0"},"lint-staged":{"{src,apps/common}/**/*.{js,ts,tsx}":"yarn format-js","src/**/*.{js,ts,tsx}":"yarn lint","apple/**/*.{h,m,mm,cpp}":"yarn format-ios","android/src/**/*.java":"yarn format-java","src/fabric/*.ts":"yarn sync-archs"},"nativePackage":true,"codegenConfig":{"name":"rnsvg","type":"all","jsSrcsDir":"./src/fabric","android":{"javaPackageName":"com.horcrux.svg"},"ios":{"componentProvider":{"RNSVGCircle":"RNSVGCircle","RNSVGClipPath":"RNSVGClipPath","RNSVGDefs":"RNSVGDefs","RNSVGEllipse":"RNSVGEllipse","RNSVGFeBlend":"RNSVGFeBlend","RNSVGFeColorMatrix":"RNSVGFeColorMatrix","RNSVGFeComposite":"RNSVGFeComposite","RNSVGFeFlood":"RNSVGFeFlood","RNSVGFeGaussianBlur":"RNSVGFeGaussianBlur","RNSVGFeMerge":"RNSVGFeMerge","RNSVGFeOffset":"RNSVGFeOffset","RNSVGFilter":"RNSVGFilter","RNSVGForeignObject":"RNSVGForeignObject","RNSVGGroup":"RNSVGGroup","RNSVGImage":"RNSVGImage","RNSVGLine":"RNSVGLine","RNSVGLinearGradient":"RNSVGLinearGradient","RNSVGMarker":"RNSVGMarker","RNSVGMask":"RNSVGMask","RNSVGPath":"RNSVGPath","RNSVGPattern":"RNSVGPattern","RNSVGRadialGradient":"RNSVGRadialGradient","RNSVGRect":"RNSVGRect","RNSVGSvgView":"RNSVGSvgView","RNSVGSymbol":"RNSVGSymbol","RNSVGTSpan":"RNSVGTSpan","RNSVGText":"RNSVGText","RNSVGTextPath":"RNSVGTextPath","RNSVGUse":"RNSVGUse"}}},"packageManager":"yarn@1.22.22","gitHead":"e37c09bfd07337560f0859bc8799ab726bef93cd","_id":"@boomsi/react-native-svg@15.15.5","bugs":{"url":"https://github.com/boomsi/react-native-svg/issues"},"_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-4xUBnBz0Jyrck0JhxPWXRcemxODwCU5aIXKv5BOG10hOvrOTBHV04XT6sAZffF/IXbxEJE4Km9rYEGA3sv2k9g==","shasum":"8ad150e3807819f6a6019e4c6ce9639463a3cf71","tarball":"https://registry.npmjs.org/@boomsi/react-native-svg/-/react-native-svg-15.15.5.tgz","fileCount":1494,"unpackedSize":3924801,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC5AjtGqzJPfamitSL9Es7JeQZ+U/wKxs7JhUkpNlCwYAIgVoTyVO4rCRrnDYVrKki8fED0yFD2sKWd6/kmrqlD2oM="}]},"_npmUser":{"name":"boomsi","email":"libo19431@gmail.com"},"directories":{},"maintainers":[{"name":"boomsi","email":"libo19431@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-native-svg_15.15.5_1788862481940_0.5782004738017268"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-08T10:14:41.496Z","15.15.5":"2026-09-08T10:14:42.115Z","modified":"2026-09-08T10:14:42.512Z"},"maintainers":[{"name":"boomsi","email":"libo19431@gmail.com"}],"description":"SVG library for react-native — fork of react-native-svg with Windows Fabric text rendering fixes","homepage":"https://github.com/boomsi/react-native-svg#readme","keywords":["react-component","react-native","ios","android","windows","SVG","ART","VML","gradient"],"repository":{"type":"git","url":"git+https://github.com/boomsi/react-native-svg.git"},"bugs":{"url":"https://github.com/boomsi/react-native-svg/issues"},"license":"MIT","readme":"# @boomsi/react-native-svg\r\n\r\n> A personal fork of [`react-native-svg`](https://www.npmjs.com/package/react-native-svg) ([software-mansion/react-native-svg](https://github.com/software-mansion/react-native-svg)) with fixes for **text rendering on the Windows Fabric (new architecture) renderer**. Behavior on iOS / Android / macOS and on the legacy Windows (Paper) renderer is identical to upstream.\r\n\r\n## Base version\r\n\r\nForked from upstream **15.15.5** (main right after `Release 15.15.5`, base commit [`7b2c7d87`](https://github.com/software-mansion/react-native-svg/commit/7b2c7d87)). Update this section whenever syncing with upstream.\r\n\r\n## Changes vs. upstream\r\n\r\nThe Windows Fabric renderer draws the whole document through D2D1's `ID2D1SvgDocument`, which **does not support `text` / `tspan`** (they are silently ignored), so all SVG text disappears. This fork paints text on top via **DirectWrite**:\r\n\r\n- `windows/RNSVG/Fabric/`: added real renderables `TextView` / `TSpanView` (previously `UnsupportedSvgView`); `SvgView` collects `TextRecord`s and paints text after `DrawSvgDocument` with `ID2D1DeviceContext::DrawTextLayout` (accurate baseline + textAnchor alignment).\r\n- **Text→TSpan style inheritance**: a `TextContext` carrying textAnchor / fontSize / fontFamily / fontWeight / fill is passed down while recursing (upstream JS wraps raw text into a prop-less `<TSpan>`, so the inheritance semantics were missing).\r\n- **tspan coordinate semantics**: `x/y` on a tspan are treated as absolute values in the text coordinate system and `dy` as a relative increment; `x/y/dx/dy` on `Text` feed the default origin of its children.\r\n- **`dominant-baseline` / `alignment-baseline`**: supports central/middle, text-before-edge/hanging and text-after-edge/bottom vertical positioning; defaults to alphabetic.\r\n- **Nested `<svg>`**: the Fabric path used to skip the whole subtree; nested svgs are now supported and their viewBox transforms accumulate into the text transform.\r\n- **JS-side prop type fixes**: `x/y/dx/dy/rotate` in `TextNativeComponent` / `TSpanNativeComponent` changed from `UnsafeMixed<NumberArray>` to `ReadonlyArray<Float>` to match the native `std::vector<float>`.\r\n\r\nFull design notes, root-cause analysis and the Windows build commands live in [CHANGE.md](./CHANGE.md) (in Chinese).\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @boomsi/react-native-svg\r\n```\r\n\r\nUsage is identical to upstream `react-native-svg` and it can be used as a 1:1 drop-in replacement. Windows Fabric hosts need to build `RNSVG.dll` from the `windows/` directory in the package (see CHANGE.md for build notes).\r\n\r\n---\r\n\r\n<p align=\"center\">\r\n  <img src=\"https://user-images.githubusercontent.com/39658211/200319759-006c214f-941c-496c-a3c2-7de5b7ce33dc.png\" width=\"100%\" alt=\"React Native SVG at Software Mansion\" >\r\n</p>\r\n\r\n[![Version](https://img.shields.io/npm/v/@boomsi/react-native-svg.svg)](https://www.npmjs.com/package/@boomsi/react-native-svg)\r\n[![NPM](https://img.shields.io/npm/dm/@boomsi/react-native-svg.svg)](https://www.npmjs.com/package/@boomsi/react-native-svg)\r\n\r\n`react-native-svg` provides SVG support to React Native on iOS, Android, macOS, Windows, and a compatibility layer for the web.\r\n\r\n[Check out the Example app](https://github.com/software-mansion/react-native-svg/tree/main/apps/common/example)\r\n\r\n- [Features](#features)\r\n- [Installation](#installation)\r\n- [Troubleshooting](#troubleshooting)\r\n- [Opening issues](#opening-issues)\r\n- [Usage](#usage)\r\n- [Known issues](#known-issues)\r\n\r\n## Features\r\n\r\n1. Supports most SVG elements and properties (Rect, Circle, Line, Polyline, Polygon, G ...).\r\n2. Easy to [convert SVG code](https://svgr.now.sh/) to react-native-svg.\r\n\r\n## Installation\r\n\r\n### With expo\r\n\r\n> ✅ The [Expo client app](https://expo.io/tools) comes with the native code installed!\r\n\r\nInstall the JavaScript with:\r\n\r\n```bash\r\nnpx expo install react-native-svg\r\n```\r\n\r\n📚 See the [**Expo docs**](https://docs.expo.io/versions/latest/sdk/svg/) for more info or jump ahead to [Usage](#usage).\r\n\r\n### With react-native-cli\r\n\r\n1. Install library\r\n\r\n   from npm\r\n\r\n   ```bash\r\n   npm install react-native-svg\r\n   ```\r\n\r\n   from yarn\r\n\r\n   ```bash\r\n   yarn add react-native-svg\r\n   ```\r\n\r\n2. Link native code\r\n\r\n   ```bash\r\n   cd ios && pod install\r\n   ```\r\n\r\n## Supported react-native versions\r\n\r\n| react-native-svg | react-native |\r\n| ---------------- | ------------ |\r\n| 3.2.0            | 0.29         |\r\n| 4.2.0            | 0.32         |\r\n| 4.3.0            | 0.33         |\r\n| 4.4.0            | 0.38         |\r\n| 4.5.0            | 0.40         |\r\n| 5.1.8            | 0.44         |\r\n| 5.2.0            | 0.45         |\r\n| 5.3.0            | 0.46         |\r\n| 5.4.1            | 0.47         |\r\n| 5.5.1            | >=0.50       |\r\n| >=6              | >=0.50       |\r\n| >=7              | >=0.57.4     |\r\n| >=8              | >=0.57.4     |\r\n| >=9              | >=0.57.4     |\r\n| >=12.3.0         | >=0.64.0     |\r\n| >=15.0.0         | >=0.70.0     |\r\n| >=15.8.0         | >=0.73.0     |\r\n| >=15.13.0        | >=0.78.0     |\r\n\r\n## Support for Fabric\r\n\r\n[Fabric](https://reactnative.dev/architecture/fabric-renderer) is React Native's new rendering system. As of [version `13.0.0`](https://github.com/react-native-svg/react-native-svg/releases/tag/v13.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.\r\n\r\n| react-native-svg | react-native |\r\n| ---------------- | ------------ |\r\n| >=13.0.0         | 0.69.0+      |\r\n| >=13.6.0         | 0.70.0+      |\r\n| >=13.10.0        | 0.72.0+      |\r\n\r\n## Troubleshooting\r\n\r\n### Unexpected behavior\r\n\r\nIf you have unexpected behavior, please create a clean project with the latest versions of react-native and react-native-svg\r\n\r\n```bash\r\nreact-native init CleanProject\r\ncd CleanProject/\r\nyarn add react-native-svg\r\ncd ios && pod install && cd ..\r\n```\r\n\r\nMake a reproduction of the problem in `App.js`\r\n\r\n```bash\r\nreact-native run-ios\r\nreact-native run-android\r\n```\r\n\r\n### Adding Windows support\r\n\r\n1. `npx react-native-windows-init --overwrite`\r\n2. `react-native run-windows`\r\n\r\n## Opening issues\r\n\r\nVerify 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:\r\n\r\n```bash\r\nreact-native info\r\n```\r\n\r\nIf 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.\r\n\r\n## Usage\r\n\r\nTo check how to use the library, see [USAGE.md](https://github.com/react-native-svg/react-native-svg/blob/main/USAGE.md)\r\n\r\n## Known issues:\r\n\r\n1. Unable to apply focus point of RadialGradient on Android.\r\n\r\n## React Native SVG is maintained by Software Mansion\r\n\r\nSince 2012 [Software Mansion](https://swmansion.com) 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](https://swmansion.com/contact/projects?utm_source=svg&utm_medium=readme).\r\n","readmeFilename":"README.md","_rev":"1-5d93a2fb57b7c541b18a4a41ac4510c9"}