An open API service indexing awesome lists of open source software.

https://github.com/chsdwn/react-native-skia-shadow

Android and iOS compatible shadows with React Native Skia.
https://github.com/chsdwn/react-native-skia-shadow

android expo ios package react-native shadow

Last synced: 11 months ago
JSON representation

Android and iOS compatible shadows with React Native Skia.

Awesome Lists containing this project

README

          



React Native Skia Shadow




Android and iOS compatible shadows with React Native Skia.




Report Bug
·
Request Feature


Table of Contents


  1. About The Project


  2. Getting Started


  3. Usage

  4. Contributing

  5. License

  6. Acknowledgments

## About the Project

Take a look at the iOS and Android screenshots below.

### iOS (iPhone 15 Pro Max)

React Native Skia Shadow iOS Screenshot

### Android (Nexus 5)

React Native Skia Shadow Android Screenshot

## Getting Started

### Peer Dependencies

#### `@shopify/react-native-skia`

##### React Native CLI

```sh
npm install @shopify/react-native-skia
```

```sh
yarn add @shopify/react-native-skia
```

- (MacOS only) Install Cocoa packages

```sh
npx pod-install
```

##### Expo

```sh
npx expo install @shopify/react-native-skia
```

### Installation

```sh
npm install react-native-skia-shadow
```

```sh
yarn add react-native-skia-shadow
```

(back to top)

## Usage

Wrap the component you want to add a shadow inside a `SkiaShadow` component.

### Props

| Prop | Type | Default |
| ----------------------- | -------- | -------------: |
| blur | `number` | |
| dx | `number` | |
| dy | `number` | |
| color | `Color` | `'black'` |
| borderRadius | `number` | `0` |
| borderTopLeftRadius | `number` | `borderRadius` |
| borderTopRightRadius | `number` | `borderRadius` |
| borderBottomLeftRadius | `number` | `borderRadius` |
| borderBottomRightRadius | `number` | `borderRadius` |

### Example

```tsx
import React from 'react';
import { StyleSheet, View } from 'react-native';
import { SkiaShadow } from 'react-native-skia-shadow';

export const App = () => {
return (





);
};

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
circle: {
width: 150,
height: 150,
borderRadius: 9999,
backgroundColor: 'red',
},
});
```

For usage details, please refer to the `src` folder of the example app. https://github.com/chsdwn/react-native-skia-shadow/tree/main/example/src

(back to top)

## Contributing

See the [contributing guide](https://github.com/chsdwn/react-native-skia-shadow/blob/main/CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

(back to top)

## License

Distributed under the MIT License. See [`LICENSE`](https://github.com/chsdwn/react-native-skia-shadow/blob/main/LICENSE) for more information.

(back to top)

## Acknowledgments

- Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
- [React Native Skia](https://github.com/Shopify/react-native-skia)

(back to top)