react-ios-corners
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

React ios corners

Demo gif

Create ios like rounded corners (squircle). Comparsion with regular border radius:

Demo gif

Demo gif

Playing with different 'roundness' setting, you can achieve look similar to iOS home screen app icons etc.

Links

https://en.wikipedia.org/wiki/Squircle

https://medium.com/minimal-notes/rounded-corners-in-the-apple-ecosystem-1b3f45e18fcc (Highly recommending!)

Usage

import { Squircle } from 'react-ios-corners';

function MyComponent() {
  return <Squircle>Hello</Squircle>;
}

Properties

export interface SquircleProps {
  radius?: number | 'auto';
  roundness?: number; // 0-1
}

It also accept any div property and passes it to the holder.

Note: box-shadow will not be visible because under the hood squircle is based on css masks.

Readme

Keywords

none

Package Sidebar

Install

npm i react-ios-corners

Weekly Downloads

39

Version

1.0.0

License

MIT

Unpacked Size

13.7 kB

Total Files

10

Last publish

Collaborators

  • pie6k