https://github.com/axtk/react-svgi
React SVGImage component
https://github.com/axtk/react-svgi
data-url react svg
Last synced: 3 months ago
JSON representation
React SVGImage component
- Host: GitHub
- URL: https://github.com/axtk/react-svgi
- Owner: axtk
- Created: 2022-11-21T18:42:19.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-08T22:06:23.000Z (about 2 years ago)
- Last Synced: 2025-03-05T09:45:53.178Z (3 months ago)
- Topics: data-url, react, svg
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/react-svgi
- Size: 103 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-svgi
*React SVGImage component*
- converts an SVG image encoded as a [data URL](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs) (`'data:image/svg+xml,...'`) into a React `` component;
- accepts all SVG attributes;
- accepts an optional `nonce` value for nested styles (via the `nonce` prop);
- can set its own nested `` to make the component more accessible (via the `alt` prop).Code:
```tsx
```
Result:
```tsx
Abstract shapes
...```