• Stars
    star
    1,894
  • Rank 24,494 (Top 0.5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Navbar component for React Native

Customizable navbar for react-native

react-native-side-menu demo

Content

Examples

Getting started

  • Install react-native-navbar:

    • By using yarn:
      $ yarn add react-native-navbar
      
    • By using npm:
      $ npm install react-native-navbar --save
      
  • Import it in the file where you want to use it:

    import NavigationBar from 'react-native-navbar';
  • Add it to your React element tree:

const styles = {
  container: {
    flex: 1,
  },
};

const rightButtonConfig = {
  title: 'Next',
  handler: () => alert('hello!'),
};

const titleConfig = {
  title: 'Hello, world',
};

function ComponentWithNavigationBar() {
  return (
    <View style={styles.container}>
      <NavigationBar
        title={titleConfig}
        rightButton={rightButtonConfig}
      />
    </View>
  );
}

That's it, you're ready to go!

API

  • style - (Object, Array) - Style object or array of style objects
  • containerStyle - (Object) - Style object for styling navbar container
  • tintColor - (String) - NavigationBar's tint color
  • statusBar - (Object):
    • style - ('light-content' or 'default') - Style of statusBar
    • hidden - (Boolean)
    • tintColor - (String) - Status bar tint color
    • hideAnimation - ('fade', 'slide', 'none') - Type of statusBar hide animation
    • showAnimation - ('fade', 'slide', 'none') - Type of statusBar show animation
  • leftButton / rightButton - (Object, React Element) - Either plain object with configuration, or React Element which will be used as a custom left/right button element. Configuration object has following keys:
    • title - (String) - Button's title
    • tintColor - (String) - Button's text color
    • style - (Object, Array) - Style object or array of style objects
    • handler - (Function) - onPress function handler
    • disabled - (Boolean) - If true, disable interactions for this button.
    • accessible - (Boolean) - Indicates that the view is an accessibility element
    • accessibilityLabel - (String, React Element) - Overrides the text that's read by the screen reader for the button.
  • title - (Object, React Element) - Either plain object with configuration, or React Element which will be used as a custom title element. Configuration object has following keys:
    • title - (String) - Button's title
    • style - (Object, Array, Number) - Style object or array of style objects
    • tintColor - (String) - Title's text color
    • ellipsizeMode - ('head', 'middle', 'tail', 'clip') - How to display the text
    • numberOfLines - (Number) - How to truncate the text

Usage with Webpack

This module uses JSX syntax and requires a compiler such as babel. React Native's packager runs this automatically but if you use Webpack be sure to compile this module from your dependencies

loaders: [{
  test: /\.js$/,
   include: [
     path.resolve(__dirname, "src"),
     path.resolve(__dirname, "node_modules/react-native-navbar")
   ],
  loader: 'babel',
  query: { stage: 0, plugins: [] }
}]

Questions?

Feel free to ping me on twitter If you want to report a bug, please submit an issue!

More Repositories

1

react-native-blur

React Native Blur component
TypeScript
3,754
star
2

react-native-side-menu

Side menu component for React Native
JavaScript
2,213
star
3

browserify-react-live

React Live Patch for browserify
JavaScript
83
star
4

react-native-network-proxy

Network debugger (logger) for React Native apps
JavaScript
74
star
5

Reactive2015

Reactive 2015 Conference contest app
JavaScript
62
star
6

ReactNativeWithSwiftUITutorial

Supportive material for the tutorial about React Native and SwiftUI
Objective-C
61
star
7

react-native-list

FlatList, VirtualizedList, SectionList for React-Native < 0.43
JavaScript
44
star
8

react-native-uber-rides

🚗 React Native port for Uber Rides SDK
Swift
33
star
9

fflux

Flux-based architecture library with immutable data support
JavaScript
31
star
10

ExampleBridge

Objective-C
27
star
11

react-navigation-parser

Parser tool for react-navigation
JavaScript
24
star
12

navigator-redux

Navigator for React-Native, driven by redux
JavaScript
18
star
13

browserify-patch-server

Patch server for browserify
JavaScript
15
star
14

jest-styled-components-matcher

Jest matcher for styled components (React Native)
JavaScript
14
star
15

metro-bundler-ui

5
star
16

fflux-isomorphic-example

Example of usage fflux for creating isomorphic apps
JavaScript
3
star
17

schemify

TypeScript compiler for React Native CodeGen project
TypeScript
3
star
18

kureev.com

JavaScript
2
star
19

veloria

Veloria is a SQLite-based ORM that aims to bring prisma-like experience for React Native
TypeScript
2
star
20

go-rfcomm-server

Draft implementation of the server that accepts Bluetooth connections using RFCOMM protocol
Go
1
star
21

hello-github-actions

Dockerfile
1
star
22

github-actions-for-ci

JavaScript
1
star