react-fullpage
made with React

react-fullpage

这是一个基于React的全屏滚动组件。

相关问答
暂无相关问题
查看全部
简介及使用教程

react-fullpage是一个基于React的全屏滚动组件,是fullpage.js的React官方封装。通过fullpage.js,你可以轻松的创建全屏滚动页面。

安装

Npm

npm install @fullpage/react-fullpage

Yarn

yarn add @fullpage/react-fullpage

使用

import React from 'react';
import ReactDOM from 'react-dom';
import ReactFullpage from '@fullpage/react-fullpage';

const Fullpage = () => (
  <ReactFullpage
    //fullpage options
    licenseKey = {'YOUR_KEY_HERE'}
    scrollingSpeed = {1000} /* Options here */

    render={({ state, fullpageApi }) => {
      return (
        <ReactFullpage.Wrapper>
          <div className="section">
            <p>Section 1 (welcome to fullpage.js)</p>
            <button onClick={() => fullpageApi.moveSectionDown()}>
              Click me to move down
            </button>
          </div>
          <div className="section">
            <p>Section 2</p>
          </div>
        </ReactFullpage.Wrapper>
      );
    }}
  />
);

ReactDOM.render(<Fullpage />, document.getElementById('react-root'));

示例

image.png

image.png

作者

Álvaro Trigo

@imac2

相关项目