Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

borderRadius not working #1393

Closed
exotexot opened this issue Jun 3, 2020 · 10 comments
Closed

borderRadius not working #1393

exotexot opened this issue Jun 3, 2020 · 10 comments

Comments

@exotexot
Copy link

exotexot commented Jun 3, 2020

Hi,

I'm looking to build a button as suggested here: #645

I do need the button to have rounded borders, which is usually achieved through borderRadius. But I dont get it to work with any of the svg elements. Any advice?

@stale
Copy link

stale bot commented Aug 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.

@stale stale bot added the stale label Aug 2, 2020
@rmacqueen
Copy link

I have a need for the same thing. Any update on this?

@stale stale bot removed the stale label Aug 29, 2020
@iggirex
Copy link

iggirex commented Sep 21, 2020

Trying to give a Rect border-radius with this library is way harder than it should be. I've landed at creating a ClipPath with two ovals on either end and a rectangle in the middle. It kinda works but feels very hacky.

There's a few built in props that sound like they'd do the trick, strokeLinecap="round", strokeLinejoin="round". But they don't seem to be doing anything in my case, and I can't find an example of using these props in the docs.

@iggirex
Copy link

iggirex commented Sep 21, 2020

ANSWER:
Give your Rect the rx prop and boom you got rounded corners.

<Rect x={0} y={0} rx={5} width={100} height={30} fill={"#ff0000"} />

Having an example of this in the docs would be helpful.

@PavanKu
Copy link

PavanKu commented Jan 14, 2021

Any update on this? I am also try to apply borderRadius to SVG element but its not working.

@smilingkylan
Copy link

Also need help with this! Why does overflow: 'hidden' not work for the wrapping ?

@J6ey
Copy link

J6ey commented Nov 10, 2021

I can set the border radius by styling View and wrapping the SVG element in it, and of course, set overflow: 'hidden'.

@RahulMore-Codes
Copy link

what if only a specific corner needs to be rounded?

@shahbazshueb
Copy link

setting rx and ry worked for me

@ShivamJoker
Copy link

rx tx makes the entire SVG invisible I am not sure what am I doing wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants