Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
expo-svg-uri
Advanced tools
Render SVG images in Expo app from an URL or a static file
npm install --save expo-svg-uri
OR
yarn add expo-svg-uri
Prop | Type | Default | Note |
---|---|---|---|
source | ImageSource | Same kind of source prop that <Image /> component has | |
svgXmlData | String | You can pass the SVG as String directly | |
fill | Color | Overrides all fill attributes of the svg file | |
stroke | Color | Overrides all stroke attributes of the svg file | |
fillAll | Boolean | Adds the fill color to the entire svg object |
Here's a simple example:
import SvgUri from "expo-svg-uri";
const TestSvgUri = () => (
<View style={styles.container}>
<SvgUri
width="200"
height="200"
source={{
uri: "http://thenewcode.com/assets/images/thumbnails/homer-simpson.svg"
}}
/>
</View>
);
or a static file
<SvgUri width="200" height="200" source={require("./img/homer-simpson.svg")} />
FAQs
Render an SVG Image
The npm package expo-svg-uri receives a total of 159 weekly downloads. As such, expo-svg-uri popularity was classified as not popular.
We found that expo-svg-uri demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.