Socket
Socket
Sign inDemoInstall

expo-svg-uri

Package Overview
Dependencies
2
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    expo-svg-uri

Render an SVG Image


Version published
Maintainers
1
Install size
4.67 MB
Created

Readme

Source

expo-svg-uri

Render SVG images in Expo app from an URL or a static file

Install

npm install --save expo-svg-uri

OR

yarn add expo-svg-uri

Props

PropTypeDefaultNote
sourceImageSourceSame kind of source prop that <Image /> component has
svgXmlDataStringYou can pass the SVG as String directly
fillColorOverrides all fill attributes of the svg file
strokeColorOverrides all stroke attributes of the svg file
fillAllBooleanAdds the fill color to the entire svg object

Usage

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")} />

Keywords

FAQs

Last updated on 04 Nov 2020

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc