All Projects → tienphaw → react-native-figma-squircle

tienphaw / react-native-figma-squircle

Licence: MIT license
Figma-flavored squircles for React Native

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to react-native-figma-squircle

acharep
🏠 App to find fraternities near your university
Stars: ✭ 23 (-88.89%)
Mutual labels:  expo
exponent-server-sdk-golang
Exponent push notification go library
Stars: ✭ 43 (-79.23%)
Mutual labels:  expo
figma-api-stub
🤖 A stub implementation of Figma Plugins API.
Stars: ✭ 33 (-84.06%)
Mutual labels:  figma
musicont
React Native & Expo music player application UI
Stars: ✭ 72 (-65.22%)
Mutual labels:  expo
phosphor-figma
A flexible icon family for Figma
Stars: ✭ 17 (-91.79%)
Mutual labels:  figma
turtle-action
🐢 Turtle CLI with GitHub Actions for building expo-project
Stars: ✭ 16 (-92.27%)
Mutual labels:  expo
Friday
🎓 Friday - Your Personal Class Manager Assistant, It'll never let you miss another assignment deadline or upcoming test.
Stars: ✭ 67 (-67.63%)
Mutual labels:  figma
react-native-boilerplate
Expo + Redux + React Navigation Pre-setup Template (expo SDK 44)
Stars: ✭ 142 (-31.4%)
Mutual labels:  expo
meteor-react-native
Meteor client for React Native matching Meteor Spec
Stars: ✭ 43 (-79.23%)
Mutual labels:  expo
snack
Expo Snack lets you run Expo in the browser.
Stars: ✭ 187 (-9.66%)
Mutual labels:  expo
figma-plugin-helpers
A collection of useful helper functions to import to your Figma plugin project
Stars: ✭ 161 (-22.22%)
Mutual labels:  figma
100daysofcode
⚠️ Programar no mínimo uma hora todos os dias, durante os próximos 100 dias!!
Stars: ✭ 28 (-86.47%)
Mutual labels:  figma
react-native-react-bridge
An easy way to integrate your React (or Preact) app into React Native app with WebView.
Stars: ✭ 84 (-59.42%)
Mutual labels:  expo
mdn-dinocons
A scalable set of icons for use across Mozilla Developer websites
Stars: ✭ 21 (-89.86%)
Mutual labels:  figma
react-native-ink
React Native for CLIs
Stars: ✭ 28 (-86.47%)
Mutual labels:  expo
figma-api
Figma REST API implementation with TypeScript, Promises & ES6
Stars: ✭ 126 (-39.13%)
Mutual labels:  figma
study-amplify-with-react-native
AWSKRUG Community Day 2020 Amplify Keynote and Demo
Stars: ✭ 15 (-92.75%)
Mutual labels:  expo
native-kitchensink
📱 Playground for ReactiveSearch Native components
Stars: ✭ 46 (-77.78%)
Mutual labels:  expo
umi-react-native
umi preset plugins for react-native
Stars: ✭ 54 (-73.91%)
Mutual labels:  expo
acgnfuns-app
A react native app based on expo, dva, etc.
Stars: ✭ 14 (-93.24%)
Mutual labels:  expo

React Native Figma Squircle

Stable Release license

Figma-flavored squircles for React Native

Disclaimer

This library is not an official product from the Figma team and does not guarantee to produce the same results as you would get in Figma.

What is this?

Figma has a great feature called corner smoothing, allowing you to create rounded shapes with a seamless continuous curve (squircles).

This library helps you bring those squircles to your React Native apps.

Installation

Install react-native-svg

Then install this library:

yarn add react-native-figma-squircle

or

npm install react-native-figma-squircle

Usage

A SquircleView can be used just like a normal View, except the background is rendered separately from the view background. So to change how it looks, you'll have to use the squircleParams prop instead of the style prop.

import { SquircleView } from 'react-native-figma-squircle'

function PinkSquircle() {
  return (
    <SquircleView
      style={{ width: 200, height: 200 }}
      squircleParams={{
        cornerSmoothing: 0.7,
        cornerRadius: 30,
        fillColor: 'pink',
      }}
    />
  )
}

You can also use it with MaskedView to apply the squircle shape to an Image.

import MaskedView from '@react-native-community/masked-view'

function ProfilePicture() {
  return (
    <MaskedView
      style={styles.profilePicture}
      maskElement={
        <SquircleView
          style={StyleSheet.absoluteFill}
          squircleParams={{
            cornerRadius: 30,
            cornerSmoothing: 0.7,
            fillColor: 'pink',
          }}
        />
      }
    >
      <Image style={StyleSheet.absoluteFill} source={{ uri: 'https://...' }} />
    </MaskedView>
  )
}

Props

Inherits View Props

squircleParams

cornerSmoothing

number | Required

Goes from 0 to 1, controls how smooth the corners should be.

cornerRadius

number | defaults to 0

topLeftCornerRadius

number

topRightCornerRadius

number

bottomRightCornerRadius

number

bottomLeftCornerRadius

number

fillColor

Color | defaults to #000

Similar to backgroundColor in the style prop.

strokeColor

Color | defaults to #000

Similar to borderColor in the style prop.

strokeWidth

number | defaults to 0

Similar to borderWidth in the style prop.

Thanks

Related

  • figma-squircle - This gives you just the SVG path so you can have your Figma-flavored squircles on other platforms as well.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].