Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rcaferati/ras-fullpage-strategies

React awesome slider fullpage strategies and usage examples.
https://github.com/rcaferati/ras-fullpage-strategies

Last synced: about 2 months ago
JSON representation

React awesome slider fullpage strategies and usage examples.

Awesome Lists containing this project

README

        

# React Awesome Slider Navigation HOC strategies
React awesome slider fullpage strategies and usage examples. For more information about the slider itself please access the main repository at [rcaferati/react-awesome-slider](https://github.com/rcaferati/ras-fullpage-strategies)

## Live preview
Access the live preview at: [fullpage.caferati.me](https://fullpage.caferati.me)

[react-awesome-slider demo](https://fullpage.caferati.me/)

## Implementation

The `Navigation` HOC exposes a number of methods for dealing with fullpage navigation. The code bellow is a basic concept example, if you want a functional one just check out the [NextJS example folder](https://github.com/rcaferati/ras-fullpage-strategies/tree/master/nextjs-example).

| Method | Type | Description |
| :---------------------- | :----------------------- | :-------------------------------------------------------------------------------- |
| Provider | `Context Provider` | A context provider component for the application to be wrapped in. |
| withNavigationContext | `Context Consumer` | A navigation context consumer for accessing the navigation object as a prop. |
| withNavigationHandlers | `Navigation Handlers` | A HOC to add the navigation handlers to your AwesomeSlider instance. |
| Link | `Link Component` | A Link component for handling page linking. |

```JS
import AwesomeSlider from "react-awesome-slider"
import 'react-awesome-slider/dist/styles.css';

import {
Provider,
Link,
withNavigationContext,
withNavigationHandlers
} from "react-awesome-slider/dist/navigation";

// Wrapp the AwesomeSlider component with the navigationHandlers
const NavigationSlider = withNavigationHandlers(AwesomeSlider);

// Create an AwesomeSlider instance with some content
const Slider = () => {
return (

Page One


},
{
slug: "page-two",
className: "page-two",
children: () =>

Page Two


}
]}
/>
)
}

// Page header navigation
const Header = () => {
return (


Page One
Page Two


)
}

// Wrapp the aplication with the navigation Provider passing down the current page slug.
const App = () => {
const slug = "[THE INITIAL RENDERED SLUG]";

return (




)
}

```