3.0.3 • Published 1 year ago

react-slide-routes v3.0.3

Weekly downloads
91
License
MIT
Repository
github
Last release
1 year ago

react-slide-routes 🏄‍♂️

The easiest way to slide React routes

npm npm npm bundle size npm peer dependency version npm peer dependency version GitHub

Fit

React Router v6

For React Router v5, please use react-slide-routes@1.1.0 and note that the usage is different.

Add

yarn add react-slide-routes

# or

npm i react-slide-routes

Use

import { Route } from 'react-router-dom';
import SlideRoutes from 'react-slide-routes';

const App = () => (
  <SlideRoutes>
    <Route path="/" element={<Home />} />
    <Route path="/about" element={<About />} />
    <Route path="/contact" element={<Contact />} />
  </SlideRoutes>
);

Live

Play a live demo here → 🤳

live

API

PropTypeRequiredDefaultDescription
animationstring'slide'Animation effect type, 'slide', 'vertical-slide', or 'rotate'
durationnumber200transition-duration in ms
timingstring'ease'transition-timing-function, one of 'ease' 'ease-in' 'ease-out' 'ease-in-out' 'linear'
destroybooleantrueIf false, prev page will still exits in dom, just invisible
comparefunction-Function to sort the routes' order (defaults to the definition order). compare will be used to routes.sort((a, b) => compare(a, b)), routes is the param to useRoutes

License

MIT License © nanxiaobei

FUTAKE

If you use WeChat, please try "FUTAKE". It's a WeChat mini app for your inspiration moments. 🌈

FUTAKE

2.2.0

1 year ago

2.1.0

1 year ago

3.0.3

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

1.1.0

2 years ago

2.0.0

2 years ago

1.0.0

3 years ago

0.14.0

3 years ago

0.13.0

4 years ago

0.12.0

4 years ago

0.11.0

4 years ago

0.10.0

4 years ago

0.9.0

4 years ago

0.8.0

4 years ago

0.7.0

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago