GithubHelp home page GithubHelp logo

phamfoo / react-native-figma-squircle Goto Github PK

View Code? Open in Web Editor NEW
311.0 311.0 15.0 666 KB

Figma-flavored squircles for React Native

License: MIT License

Shell 0.79% TypeScript 82.73% JavaScript 16.48%
expo figma react react-native squircle

react-native-figma-squircle's People

Contributors

krisztiaan avatar phamfoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-native-figma-squircle's Issues

Weird behavior with stroke

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.

  • ios exemple (look at right side)

Capture d’écran 2022-05-23 à 14 50 02

  • same android exemple (bottom)

Capture d’écran 2022-05-23 à 14 49 52

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,
     }}
/>

Does not play nice with PlatformColor

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

How about mapping style attributes instead of squircle params?

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)
image

Just wondering what you think :)

Help needed with creating squircle buttons

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 :)

Shadows not rendering on Android

Versions

  • "react-native": "0.64.3"
  • "expo": "43.0.0"
  • iOS 15
  • Android 12.0

Screenshots

  • iOS

Screen Shot 2021-12-17 at 9 37 43 PM
Screen Shot 2021-12-17 at 9 38 01 PM

  • Android

Screen Shot 2021-12-17 at 9 22 57 PM
Screen Shot 2021-12-17 at 9 37 56 PM

Styles

style={{
  ...
  shadowColor: '#000',
  opacity: 0.4,
  shadowOffset: {
    width: 0,
    height: 5,
  },
  shadowOpacity: 0.34,
  shadowRadius: 6.27,

  elevation: 10,
}}

Invalid URL: should be a string. Was: null

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

Stroke with MaskedView not working

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>

Apply border Bottom/Top/Left/Right Radius

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.