All Questions
Tagged with react-native-svg svg
122 questions
0
votes
0
answers
41
views
React Native: TypeError with SvgText component on Android but not on iOS
Problem
I'm working on a React Native project using TypeScript and react-native-svg to create an AttendanceCard component that includes a circular progress chart and percentage text. The component ...
1
vote
3
answers
197
views
Progress border around an Elliptical or Rounded-Rectangular View in React Native
I'm working on a React Native project where I need to display a progress indicator that outlines a non-circular view.
I tried using react-native-svg with the Circle component to create a circular ...
0
votes
1
answer
83
views
React Native DWG to SVG conversion issue
I am building a facility management app. I have been given a .DWG file of the floor plan that I want to show on the app and make the desks and chairs clickable so that employees of that facility can ...
0
votes
0
answers
21
views
I'm using the SvgUri package to render images. But not able to see while the app taken but connected via usb is working
This how I have imported
import Detail_R_Arrow from '../assets/images/detailRarrow.svg';
export {
Back_Arrow,}
This is my import statement
import SvgUri from 'react-native-svg-uri';
This how I ...
0
votes
1
answer
107
views
SVG Path with Rounded Ends
I'm trying to create a filled ellipse graph in React Native using react-native-svg that visually indicates a percentage. The filled part should have rounded ends, but I'm struggling to get the ...
0
votes
1
answer
1k
views
Using Playwright - how to test SVG image by d values?
In the website I'm automating, there are SVG images with icons.
In once scenario, the SVG has a special arrow that points up and right.
<svg class="SecretClass" focusable="false" viewBox="0 0 ...
0
votes
1
answer
52
views
In SVG, how to center Text along a path?
Objective: Create a curved Path from A to B. Center the text on the path.
It doesn't seem like this is possible.
In my example below, startOffset=50% will begin the text at the 50% mark. However, I'd ...
1
vote
0
answers
164
views
React native svg transformer does not color svg using replaceAttrValues
I'm trying to color a svg using react-native-svg-transformer and react-native-svg but it does not work. I have the impression that the file .svgrrc is not taken into consideration because wether I ...
0
votes
0
answers
82
views
React native SVG transformer imported SVG misses coordinates properties
In a previous Ionic app I'v used an SVG viewbox to layout an app screen with multiple SVG files to make a complex combination. The viewbox ensured that the ratio remained correct over all devices. For ...
-1
votes
1
answer
82
views
SVG not filling out like fontawesome icons like it has padding or whitespace
Can anyone tell me why this custom SVG on the right won't fill the height like the icon on the right does? The SVG does not have any space on the top and right when opened in Illustrator.
Current SVG ...
1
vote
1
answer
909
views
Problem with `react-native-svg` in Expo app
I'm encountering an issue while using the react-native-svg library in my Expo app. The error message I'm seeing is:
View config getter callback for component RNSVGPath must be a function (received ...
0
votes
1
answer
367
views
SVGR has dropped some elements not supported by react-native-svg: filter
how to use my svg file in react native, i tried converting svg to react native and there is a warning: "/* SVGR has dropped some elements not supported by react-native-svg: filter */" and it ...
1
vote
2
answers
456
views
How to optimize custom svg component in react or react native to only import / load used svg
I am creating a custom category component that will load all of my SVGs listed in an object.
import { type SvgProps } from 'react-native-svg';
import FoodAndDrink from './icon-svgs/food-and-drink.svg'...
1
vote
0
answers
53
views
How to search the JSX file in react native
I have a svgComponent JSX file in react native. in that I have almost 200 path components. i want to plot some circle on this world map based on data getting from API.
how to search the path component ...
1
vote
1
answer
243
views
Masking Image With Hollow Circle Shape & Blur
I'm trying to create the below crude example using react-native-svg.
The background image is dynamic and requires a hollow circular mask. This also needs to blur that section of the background image. ...
1
vote
0
answers
160
views
Interpolating color of a custom Animated component in react native
I created a custom animated component in react native like this:
const AnimatedPath = Animated.createAnimatedComponent(Path);
where Animated is imported from react-native and Path is imported from ...
0
votes
1
answer
247
views
How to calculate viewbox for an individual path in a svg in react native
I am trying to make every path of svg as independent svg.
I wasn't able to find any method to directy get the viewbox for a path.
take this svg as example:
import Svg, { Path } from 'react-native-svg';...
0
votes
0
answers
116
views
How to highlight nested elements inside SVG and change their color or highlight them in react native
We have a map of a mall which is an image(SVG, or PNG), I'm asked to do the following:
there is an input above the Map where user can look for a store by name, when a store is chosen it should be ...
5
votes
0
answers
203
views
React-Native-SVG: Masked elements pixelated in android emulator
In my app I have this code:
<Svg width={W} height={H} viewBox={viewBox} style={style} preserveAspectRatio="none">
<Defs>
<Mask id="mask" x={0} y={0}...
1
vote
1
answer
404
views
How can I make a circular graph with SVG in React Native?
I'm trying to draw a circular graph with SVG in React Native. I want to add a stroke to the chart. How can I do it?
I did this.
This is what I want to do.
Code:
return (
<View style={{ ...
0
votes
1
answer
741
views
Accessing text elements in external SVG files with javascript
If I create the SVG within HTML and give the text items I want to change IDs, I have no problem accessing the ID using
let callQSO = document.getElementById("QSOcall").value;
and then ...
0
votes
0
answers
178
views
Why is my SVG coordinate system supporting negative coordinates?
I am trying to draw a rectangle in React-Native using the react-native-svg package as follows:
<View
style={{
width: '100%',
height: 200,
borderWidth: 1,
}}
>
<Svg height='...
0
votes
0
answers
285
views
Creating a Specific Path in React Native
I need your help...I am developing a React Native application and the app has some svg components, I've built a circular progress indicator and now I want to add dashed border in. I know I could've ...
1
vote
1
answer
217
views
SVGR removing style tag in react native expo appliction and svg component is not rendered in android in React native expo app
I have .svg file which I am converting svg component using SVGR. But SVGR has removed style tag in my .svg file.
This was original .svg file with style tag
viewBox="0 0 385.11 279.06" ...
1
vote
0
answers
474
views
Error in using SvgXml from react native svg in react native svg app
I am creating react native app for (Web, IOS,Android). I have svg image that i want to render in web and android. This is my code :
import React from "react";
import { SvgXml } from "...
1
vote
0
answers
958
views
Using Svg images from url in react native expo application
I have React native expo app that works in WEB, IOS & ANDROID. I have installed react-native-svg to show svg images from URL. It is working fine with web , but on expo android emulator it showing ...
0
votes
1
answer
621
views
unable to import svg in react native : None of these files exist
I am trying to import svg which I converted into jsx using transform.tools. However when I try to import it into my component it says unable to resolve module : none of these files exist.
I checked ...
1
vote
1
answer
636
views
Loading delay when using react-native-svg
I am using react-native-svg for handling SVG but i am noticing a delay when switching to a stack/screen that contains SVG. I am using a tabBar in react-navigation 6 to switch stacks/screens.
When i ...
1
vote
0
answers
1k
views
React Native Svg error: "Invariant Violation: requireNativeComponent: "RNSVGPath" was not found in the UIManager."
I have created a library of components and commands for react-native using "react-native-builder-bob" https://github.com/callstack/react-native-builder-bob.
Trying to create an "Icon&...
2
votes
0
answers
343
views
In react-native-svg, how can I prevent <Text> from being cut-off in a <TextPath>?
I am creating a simple compass with North, East, South, West directions. I created a TextPath so that my Text can curve along the circular compass.
I am facing one major problem: the beginning of the ...
1
vote
1
answer
678
views
how can I make image take full shape size of SVG path?
I'm trying to fill the frame shape (svg path) with image of each player (dynamic image)
<Svg
xmlns='http://www.w3.org/2000/svg'
width={182.545}
style={{}}
height={221.987}
...
0
votes
1
answer
287
views
Why are only certain SVG visable with react-native-svg
So I am using .svg as icons for my app, and they're hosted online. Some work and others are simply not visible. This is the code I am using.
import { SvgUri } from "react-native-svg";
import ...
2
votes
1
answer
910
views
SVG icon showing cutoff on android in react native
I am using lib react-native-svg to display SVG in my mobile app. In iOS, it is showing properly but on android, it shows cutoff. I will also attach a screenshot for reference, Can someone please help ...
0
votes
1
answer
691
views
Svg icon does not look the same using react-native-svg compared to standard html
I exported in svg format an icon designed in Figma and copied it into my react-native project as seen here, the only change I have done to adapt it to react-native-svg is to use high-caps on Line and ...
2
votes
1
answer
1k
views
React Native SVG loading indicator for remote SVGs
I am rendering SVGs from remote URLs:
import { SvgUri } from "react-native-svg";
function RemoteSVG() {
return (
<SvgUri
uri={"https://cdn.orsive.com/avatars/...
0
votes
0
answers
504
views
react-native-svg "rect" height: 100% not filling screen
Cannot get Rect to fill screen.
Example Snack: https://snack.expo.dev/7hfIOdDDX
Demo Code:
<View style={StyleSheet.absoluteFill}>
<Svg height="100%" width="100%" viewBox=...
1
vote
0
answers
120
views
Add fixed color in LinearGradient using react-native-svg
I am workign on a Svg component where i'm using LinearGradient from react-native-svg. I want to used fixed colors on stop points. But using LinearGradient, it's not being possible to do that. How can ...
1
vote
0
answers
602
views
react-native-svg path does not fill whole svg height
My path fills the SVG horizontally perfectly by vertically it has spacing to the top and bottom as you can see.
How can I remove that spacing and have the path fill the entire height of the SVG ...
0
votes
0
answers
669
views
How to use an SVG to make a hole in a <View /> (React Native)
I have the following shape in a React Native app.
and I want to shape it like you see here
Problem: This isn't responsive, if I use an SVG it stretches and shrinks the whole thing, including the ...
1
vote
2
answers
2k
views
react-native-svg - Marker / Line markerEnd doesn't work on Android
Simply trying to draw an arrow line using the following code
import * as React from 'react';
import { Text, View, StyleSheet } from 'react-native';
import Svg, { Defs, Line, Marker, Path } from "...
1
vote
1
answer
799
views
react-native-svg - Fill overlapped area of two ellipses
We are using react-native-svg library to draw ellipses having following code
<Svg>
<Ellipse cx={192} cy={190} rx={50} ry={80} stroke={"red"} strokeWidth="2"/>
...
0
votes
1
answer
2k
views
How to manage dynamic fill with React Native SVG
I have some SVGs in my React native .66.1 app, and I've set up react-native-svg and react-native-svg-transformer and have set it up correctly. I can import my SVGs as components, and it all works as ...
1
vote
0
answers
1k
views
How to use linearGradient in react-native-svg
I have some SVG graphics that I would like to apply conditional styling on (e.g. linearGradient when it's active). How would I go about achieving this? I'd rather not (if there's another way) have to ...
0
votes
0
answers
283
views
Gradient SVG render on web but not on mobile
I'm using react-native-svg to render a chart, which contain a gradient, work perfectly on web, but when use the same code on react-native it won't work
Here is the react-native code
const data = [
{...
2
votes
1
answer
2k
views
react-native-svg: LinearGradient doesn't change between components when given different colors
I have a component that generates a square linear gradient using react-native-svg. When I pass in different hue colors, it stays the same color.
Things I tried:
Passing in hex instead of hsl colors ...
0
votes
0
answers
327
views
React Native - Implementing Eraser Function in SVG
I'm implementing an Eraser for drawing on a React Native application.
The drawings in the application were implemented using SVG.
Found this very helpful answer on how to go about it by using Masks.
...
0
votes
1
answer
1k
views
Using SVG Pattern as Background
React-Native-svg supports SVG pattern, however, I am not sure how to apply it...
When I try the minimal example from the documentation, I get a blanc screen, white screen.
<View
style={{...
2
votes
1
answer
1k
views
How to properly render SVG in React Native
Hi Have the following code in our react native application:
import { SvgCssUri } from 'react-native-svg';
<SvgCssUri style={styles.osIcon} uri={'https://mon.zappiehost.com/images/os/' + props.data....
2
votes
0
answers
356
views
react-native-svg Image defined in Pattern located on wrong coordinates
I have a .svg which looks like this:
So those are a few rectangles with border radius that have image as a background. That .svg was exported from Figma and I used react-svgr.com to convert it to a ...
0
votes
1
answer
557
views
Is it possible to make a continuous react-native-svg animation of sine curve? [closed]
I am trying to make a sine curve slowly move and appear continuously, exactly like this (the one on the right):
Is it possible? If so, how would I approach it?