Drawer

Custom component for rendering side drawer.


import { Drawer } from 'react-native-magnus'

const drawerRef = React.createRef();

<Drawer ref={drawerRef} />

<Button
  onPress={() => {
    if (drawerRef.current) {
      drawerRef.current.open();
    }
  }}
>
  Open Drawer
</Button>

Props

PropertyDescriptionTypeDefault
mmargin`stringnumber`
mtmargin top`stringnumber`
mrmargin right`stringnumber`
mbmargin bottom`stringnumber`
mlmargin margin left`stringnumber`
mxmargin horizonal`stringnumber`
mymargin vertical`stringnumber`
ppadding`stringnumber`
ptpadding top`stringnumber`
prpadding right`stringnumber`
pbpadding bottom`stringnumber`
plpadding margin left`stringnumber`
pxpadding horizonal`stringnumber`
pypadding vertical`stringnumber`
bgbackground colorstringwhite
backdropColorbackdrop color for drawerstringblack
drawerPercentagewidth of drawer in percentagenumber70
roundedborder radius`stringnumber`
roundedTopborder radius top`stringnumber`
roundedBottomborder radius bottom`stringnumber`
roundedLeftborder radius left`stringnumber`
roundedRightborder radius right`stringnumber`
borderColorcolor for borderstring-
borderTopColorcolor for border topstring-
borderRightColorcolor for border rightstring-
borderLeftColorcolor for border leftstring-
borderBottomColorcolor for border bottomstring-
borderWidthwidth for bordernumber-
borderTopWidthwidth for border topnumber-
borderRightWidthwidth for border rightnumber-
borderLeftWidthwidth for border leftnumber-
borderBottomWidthwidth for border bottom
directiondirection of drawer`“left’“right”`
animationTimeanimation time for drawernumber300