Giter VIP home page Giter VIP logo

react-native-super-ellipse-mask's Introduction

SuperEllipse

Apple flavored smooth corners for React Native (iOS only).

Screenshots

Individual Corners

Install

yarn add react-native-super-ellipse-mask

Link

Automatic

react-native link react-native-super-ellipse-mask

Manual

iOS
  1. In XCode, in the project navigator, right click Libraries > Add Files to [your project's name]
  2. Go to node_modules > react-native-super-ellipse-mask and add RNSuperEllipseMask.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNSuperEllipseMask.a to your project's Build Phases > Link Binary With Libraries
  4. Run your project (Cmd+R)

Usage

<SuperEllipseMask radius={30}>
  <View
    style={{
      width: 200,
      height: 300,
      backgroundColor: 'black',
    }}
  />
</SuperEllipseMask>

Props

  • radius object | number: Sets the corner radius.
    • number: uniform corner radius.
    • object: {topLeft, topRight, bottomRight, bottomLeft}

Contribute

Found a bug? File an issue
Already know how to fix it? Open a Pull Request

react-native-super-ellipse-mask's People

Contributors

everdrone 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

Watchers

 avatar  avatar  avatar  avatar

react-native-super-ellipse-mask's Issues

Not working in android

It is not working in android . i had try to add it mannualy ,

in app build.gradle

compile project(':react-native-super-ellipse-mask')
in Setting.gradle

include ':react-native-super-ellipse-mask'
project(':react-native-super-ellipse-mask').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-super-ellipse-mask/android')

but throwing error

Failed to resolve: project :react-native-super-ellipse-mask
Open File

help me to solve this , library is working fine as expacted in IOS

Mention react-native-squircle-view in the readme?

https://github.com/everdrone/react-native-squircle-view

PS: I ported this library, react-native-super-ellipse-mask, to work on macOS via my fork of react-native-macos. You can see the changes I made here if interested.

I even added borderWidth/borderColor support in this commit, which was especially tricky since I wanted it to be (almost) identical to borders in react-native core. For example, the border must appear under any children and never exist beyond the bounds of the view.

I didn't know about react-native-squircle-view until today, after I finished porting.. ๐Ÿ˜…

Example Files

It would be great to have an example!

Just testing the package looks good!

Doesn't redraw

If the view redraws with new dimensions, the mask doesn't redraw.

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.