https://github.com/xiaody/react-navigate
Navigation between views on web with React.JS
https://github.com/xiaody/react-navigate
react-component
Last synced: about 1 year ago
JSON representation
Navigation between views on web with React.JS
- Host: GitHub
- URL: https://github.com/xiaody/react-navigate
- Owner: xiaody
- License: mit
- Created: 2016-12-17T08:44:03.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-03-29T11:58:45.000Z (about 2 years ago)
- Last Synced: 2024-04-25T14:00:49.981Z (about 2 years ago)
- Topics: react-component
- Language: JavaScript
- Homepage: https://xiaody.github.io/react-navigate
- Size: 716 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://david-dm.org/xiaody/react-navigate)
[](http://standardjs.com/)
# react-navigate
Navigation on web for React.JS https://xiaody.github.io/react-navigate
## Installation
To install the stable version:
```
npm install --save react-navigate
```
## Usage
```jsx
import Navigation, {NavLink} from 'react-navigate'
import 'react-navigate/src/Navigation.css'
const views = {
home: {
name: 'home',
title: 'Home page',
content () {
return (
go to About
)
}
},
about: {
name: 'about',
title: 'Abount',
content: 'Oh!'
}
}
```
## Options
- props.viewsMap
- props.defaultViewName
- props.height
- props.headerHeight
- props.backButton
- props.className
- props.titleClassName
- props.bodyClassName
- props.onWillNav
- props.onDidNav
## Limitations
- scroll position isn't kept when switching between views, because the DOM is destroyed and re-created
- no back button title support
- require modern browsers env
## License
MIT