react-native-squircle-layout
v1.1.1
Published
A React Native component that allows you to create squircle shapes.
Downloads
19
Readme
react-native-squircle-layout
A React Native component that renders a squircle shape. This component allows you to create a squircle shape with a color of your choice and use it as a background for other components.
Installation
npm install react-native-squircle-layout
or
yarn add react-native-squircle-layout
Usage
Import the SquircleView component and use it to wrap your components.
import { SquircleView } from 'react-native-squircle-layout';
function App() {
return (
<SquircleView
cornerRadius={20}
cornerSmoothing={1}
color="#3498db"
width={200}
height={200}
style={{ justifyContent: 'center', alignItems: 'center' }}
>
{/* Your content here */}
</SquircleView>
);
}
export default App;
Note: If width and height are not provided, the squircle will dynamically size itself based on its children.
Note: You can also set width and height as the color to have a solid squircle shape without children.
Props
Other View Props
All other View props from React Native are supported.
Example
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
Made with create-react-native-library