1.0.3 • Published 7 months ago

@xavirn/react-native-sidenav v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

react-native-sidenav

A customizable SideNav component for React Native with TypeScript support. This component provides smooth animations, optional overlay, and configurable positioning on either side of the screen, making it ideal for creating sliding navigation menus.

Installation

To install react-native-sidenav:

npm install react-native-sidenav

To install the required peer dependencies:

npm install react-native-gesture-handler react-native-reanimated react-native-safe-area-context

Usage

TBC

Props

ParameterTypeDefaultDescription
stateboolean-Controls whether the SideNav is open (true) or closed (false).
toggle() => void-Function to toggle the SideNav's open/close state.
position'left' \| 'right'-Position of the SideNav on the screen, either "left" or "right".
widthPercentagenumber50Width of the SideNav as a percentage of the screen width (between 0 and 100).
overlaybooleantrueSpecifies whether an overlay should be displayed behind the SideNav.
overlayOpacitynumber50Opacity level of the overlay (0-100), applicable only if overlay is true.
animationDurationnumber200Duration of the open/close animation in milliseconds (between 100 and 10000).
bgColorstringwhiteBackground color of the SideNav.
paddingnumber \| [number, number] \| [number, number, number, number]16Padding inside the SideNav. Accepts a single value, vertical/horizontal pair, or four values for top, right, bottom, and left.
isTabsbooleanfalseAdjusts bottom padding if SideNav is used with a bottom tab navigator.
childrenReact.ReactNode-Content rendered inside the SideNav, typically navigation elements or a menu.

Dependencies

This component relies on the following peer dependencies for gestures, animations, and safe area handling, which should be installed alongside react-native-sidenav:

  • react-native-gesture-handler
  • react-native-reanimated
  • react-native-safe-area-context
1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

9 months ago

0.1.3

9 months ago

0.1.2

9 months ago

0.1.1

9 months ago

0.1.0

9 months ago

0.9.0

9 months ago