@fullpage/react-fullpage

中文文档
0.1.49发布于 2025/07/04TypeScriptCommonJS近 30 天下载 2.2万

FullPage.js 的官方反应包装器

中文使用文档
文档目录20 节
  1. 浏览器支持
  2. 目录
  3. 安装
  4. 许可证
  5. 非开源许可证
  6. 开源许可证
  7. 使用量
  8. UMD 图像
  9. 服务器侧面渲染( SSR)
  10. 安全部门改革实例:
  11. 实例
  12. 快速启动示例 :
  13. Fullpage.js 扩展示例 :
  14. 状态
  15. 道具
  16. 方法
  17. 回电
  18. 样式
  19. 捐款
  20. 资源

反应全页

preview

官方反应包装 完整页.js 库

react-fullpage version

浏览器支持

IE / Edge
IE / 边缘
Firefox
火花
Chrome
颜色
Safari
萨法里
iOS Safari
iOS 萨法里
Samsung
三星,三星,三星,三星,三星
Opera
歌剧
IE11,边缘上两个版本上两个版本上两个版本上两个版本上两个版本上两个版本

目录

安装

npm install @fullpage/react-fullpage

这将安装包装以及 完整页.js

许可证

非开源许可证

如果您想使用反应-全页来开发非开源网站,主题,项目和应用程序,商业许可证就是适当的许可证. 使用此选项, 您的源代码为专有 。 也就是说,你不必将整个应用程序的源代码更改为开源许可证. 购买全页商业许可证。 。 。 .

开源许可证

如果您正在创建一个与该许可兼容的开源应用程序 GNU GPL 许可证 v3,您可以根据GPLv3的规定使用全Page.

JavaScript 和 CSS 文件中的信用注释应当完整保存 (即使在合并或微分之后)

更多信息,请查看Page的驾照。 。 。 .

使用量

此包装器创建 <ReactFullpage /> 组件。 它暴露出一个渲染道具 API,所以在整页.js库中标记可以保持不变。 渲染道克接受其回调中包含组件反应属性状态,上下文等参数的1个参数.

UMD 图像

对于没有建设步骤的人,可提供UMD捆绑.

import ReactFullpage from '@fullpage/react-fullpage-umd'; // will return static version on server and "live" version on client

服务器侧面渲染( SSR)

SSR 被支持, 但是服务器发送的 html 将不会被样式化, 这是因为 window 必须在场才能正确设置 height + 键 width 幻灯片。 只要您在浏览器环境中将您的整页组件再加水,就会应用正则样式.

当使用 SSR 或 ext.js 等框架时,组件会根据存在的动态调整自身 window

import ReactFullpage from '@fullpage/react-fullpage'; // will return static version on server and "live" version on client

安全部门改革实例:

你可以找到一个 盖茨比 (单位:千美元) 下一个.js 实例 “实例”文件夹但这里还有其它的: 加兹比 下一个.js

实例

深入的例子可以找到 这里您可以从 反应示例。 。 。 .

快速启动示例 :

import React from 'react';
import ReactDOM from 'react-dom/client';
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>
      );
    }}
  />
);

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

Fullpage.js 扩展示例 :

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

// NOTE: if using fullpage extensions/plugins put them here and pass it as props
const pluginWrapper = () => {
  require('./statics/fullpage.scrollHorizontally.min');
};

const Fullpage = () => (
  <ReactFullpage
    pluginWrapper = {pluginWrapper}

    //fullpage options
    licenseKey = {'YOUR_KEY_HERE'}
    scrollingSpeed = {1000} /* Options here */
    scrollHorizontally = {true}  /* Because we are using the extension */
    scrollHorizontallyKey = {'YOUR KEY 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>
      );
    }}
  />
);

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

通知在使用时 fullPage.js 扩展名 你会通过 pluginWrapper 函数道具,用于在 react-fullpage 组件已安装.

状态

包装机根据最新版本的fullpage.js保持状态 调用

引发状态变化的最新召回事件将作为 state.lastEvent

注:如果通过v2道具,状态将映射到v2 调用

道具

你可以使用任意 选项 由完整Page.js库作为反应道具支持.

道具对象可以包含标准 选项 以及全页.js 调用。 。 。 .

示例

更多回调 这里

方法

fullPage.js 包含许多 方法。 。 。 . 你可以使用其中的任何一种。 这些物品作为进口物品提供 fullpage.js 一旦第一次渲染已经发生,则会创建库.

回电

每一个传入组件的回调名称将保持状态本身,这将通过 渲染道具 回调参数和由fullpage.js发射的最新回调将反映在 状态。 。 。 .

样式

所有满页.js样式均通过 a 从组件中加载 <style/> 用 Javascript 创建的标签。 要覆盖整页.js样式,您必须匹配特异性。 示例 这里 输入 overrides.css 文件

捐款

有问题吗? 有主意吗? 看看这个 捐款 引导和打开 PR

资源

版本与发布记录

@fullpage/react-fullpage 共发布 56 个版本,首次发布于 2018/07/31;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.1.49latest2025/07/041.4 年前
0.1.482025/01/281.8 年前
0.1.472025/01/191.8 年前
0.1.462024/12/081.9 年前
0.1.452024/10/172 年前
0.1.442024/09/062 年前

关于 @fullpage/react-fullpage 的常见问题

@fullpage/react-fullpage 是什么?

FullPage.js 的官方反应包装器

如何安装 @fullpage/react-fullpage?

在项目目录运行 npm install @fullpage/react-fullpage,或使用 pnpm add / yarn add / bun add。

@fullpage/react-fullpage 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@fullpage/react-fullpage 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@fullpage/react-fullpage 可以商用吗?

@fullpage/react-fullpage 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@fullpage/react-fullpage 的下载量有多少?

根据 npm 官方下载统计,@fullpage/react-fullpage 在 2026/10/16 – 2026/11/14 这 30 天内被下载 21,509 次,日均约 717 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fullpage/react-fullpage 还在维护吗?

最新版本 0.1.49 发布于 2025/07/04(1.4 年前);至今共发布 56 个版本,其中过去 12 个月发布了 0 个;首次发布于 2018/07/31。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。