1.0.3 • Published 4 years ago

react-native-inset-shadow v1.0.3

Weekly downloads
781
License
Unlicense
Repository
github
Last release
4 years ago

npm version

react-native-inset-shadow

Inset shadows for react native components

Setup

This library is available on npm, install it with: npm i react-native-inset-shadow or yarn add 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

Roadmap

  • Add linter