2.1.2 • Published 2 years ago

@wave909/react-native-inset-shadow v2.1.2

Weekly downloads
-
License
Unlicense
Repository
github
Last release
2 years ago

npm version

@wave909/react-native-inset-shadow

Inset shadows for react native components

Fork of https://github.com/rohailaltaf/react-native-inset-shadow that adds support for:

  • Full Android styling
  • TypeScript

Setup

This library is available on npm, install it with: npm i @wave909/react-native-inset-shadow or yarn add @wave909/react-native-inset-shadow

Usage

import InsetShadow from 'react-native-inset-shadow'
import { Text, View } from 'react-native' 

const ViewWithInsetShadow = () => {
  return (
    <View style={{ height: 150 }}>
      <InsetShadow>
        <View style={{ flex: 1, justifyContent: 'center', alignSelf: 'center'}}>
          <Text>This view has an inset shadow!</Text>
        </View>
      </InsetShadow>
    </View>
  )
}

Props

NameTypeDefaultDescription
childrennodenull(Required) child components to sit inside the view
leftbooltrue(Optional) show left inset shadow?
topbooltrue(Optional) show top inset shadow?
rightbooltrue(Optional) show right inset shadow?
bottombooltrue(Optional) show bottom inset shadow?
shadowColorstringblack(Optional) shadow color
shadowOffsetnumber1(Optional) how much to offset the shadow on the horizontal/vertical axis
shadowOpacitynumber0.5(Optional) shadow opacity
shadowRadiusnumber3(Optional) shadow radius
elevationnumber5(Optional) shadow elevation for android
containerStyleobject{}(Optional) style for the container