phamfoo / react-native-figma-squircle Goto Github PK
View Code? Open in Web Editor NEWFigma-flavored squircles for React Native
License: MIT License
Figma-flavored squircles for React Native
License: MIT License
Hello!
The stroke doesn't look right both on ios and android.
I've made tests with different rectangle sizes; sometimes it is defaulted, sometimes not.
the code :
<SquircleView
style={{
width: BUTTONS_WIDTH,
height: 50,
}}
squircleParams={{
cornerSmoothing: 1,
cornerRadius: 10,
strokeWidth: 2,
strokeColor: "#000",
fillColor: "#fff",
}}
/>
<SquircleView
style={{
width: BUTTONS_WIDTH,
height: 50,
}}
squircleParams={{
cornerSmoothing: 0.5,
cornerRadius: 10,
fillColor: "pink",
strokeColor: "red",
strokeWidth: 2,
}}
/>
Hey,
Just something to consider, if Skia is available for the app, we could just use Skia.SVG.MakeFromString
or similar, to have a more efficient SVG component?
Skia docs: https://shopify.github.io/react-native-skia/docs/images-svg/#svg-support
I get the following error:
"[object Object]" is not a valid color or brush
import { PlatformColor } from 'react-native'
<SquircleView
style={style}
squircleParams={{
cornerSmoothing: 0.7,
cornerRadius: 30,
fillColor: PlatformColor(`systemBlue`)
}}
/>
nvm. sry
Not sure if it's worth the API break, but I'm wondering if it wouldn't by nicer to map style attributes likeborderColor
and backgroundColor
instead of having a separate squircleParams
attribute.
It would make it easier to use it as a drop in replacement when moving from Views to smooth corners.
In my project I'm using a wrapper like this (ignore the project specific defaults)
Just wondering what you think :)
First off... a great library for creating truly squircle components, thanks a lot for this!
Is it possible to wrap react buttons with this wrapper to get squircle buttons? If yes can you please provide a usage example for the same?
Thanks in advance :)
Hello, i have this issue:
[Unhandled promise rejection: Invariant Violation: Invalid URL: should be a string. Was: null] at node_modules/figma-squircle/dist/figma-squircle.cjs.development.js:52:2 in drawTopRightPath
RN: 0.64.3
Hi, I can't apply borders to squircle with an Image
<MaskedView
style={{
height: 78,
width: 94,
}}
maskElement={
<SquircleView
style={StyleSheet.absoluteFill}
squircleParams={{
cornerRadius: 22,
cornerSmoothing: 1,
fillColor: "pink",
strokeColor: "#000000",
strokeWidth: 2,
}}
/>
}
>
<Image
style={StyleSheet.absoluteFill}
source={{
uri: "https://images.unsplash.com/photo-1655219282830-7ecd31afac68?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1287&q=80",
}}
/>
</MaskedView>
Greetings!
I am looking for a to use your library in order to apply a border radius (with smoothing) only at the top or bottom of the component.
it actually possible ?
Thanks for your work!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.