alvarotrigo/react-fullpage hiện có 1.3k sao trên GitHub, viết chủ yếu bằng JavaScript. Official React.js wrapper for fullPage.js https://alvarotrigo.com/react-fullpage/
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Official React wrapper for the fullpage.js library
Demo online | CodeSandbox
fullpage.js Extensions
Brought by @imac2 thanks to Michael Walker.
Browsers support
IE / Edge
Firefox
Chrome
Safari
iOS Safari
Samsung
Opera
IE11, Edge
last 2 versions
last 2 versions
last 2 versions
last 2 versions
last 2 versions
last 2 versions
Table of Contents
Installation
License
Usage
Examples
State
Props
Methods
Callbacks
Contributing
Resources
Installation
npm install @fullpage/react-fullpage
This will install the wrapper as well as fullpage.js
License
Non open source license
If you want to use react-fullpage to develop non open sourced sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary. Which means, you won't have to change your whole application's source code to an open source license. Purchase a Fullpage Commercial License.
Open source license
If you are creating an open source application under a license compatible with the GNU GPL license v3, you may use fullPage under the terms of the GPLv3.
The credit comments in the JavaScript and CSS files should be kept intact (even after combination or minification)
Read more about fullPage's license.
Usage
This wrapper creates a <ReactFullpage /> component. It exposes a render-prop API so markup can remain the same across fullpage.js libraries. The render prop accepts 1 parameter in its callback which contains the component's react properties state, context, etc.
UMD
A UMD bundle is available for those without a build step.
import ReactFullpage from '@fullpage/react-fullpage-umd'; // will return static version on server and "live" version on client
Server Side Rendering (SSR)
SSR is supported however the server-rendered html will not be styled, this is because window must be present in order to properly set height + width of slides. So long as you rehydrate your fullpage component in the browser environment, regular styles will be applied.
When using SSR or a framework such as next.js, the component adjusts itself dynamically according to the presence of window
import ReactFullpage from '@fullpage/react-fullpage'; // will return static version on server and "live" version on client
SSR Examples:
You can find a Gatsby and a Next.js examples in the "examples" folder. But here you have others too:
gatsby
next.js
Examples
In-depth examples can be found here. You can start with the React Example.
Quickstart Example:
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 Extension Example:
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 />);
Notice that when using any fullPage.js extension you'll pass the pluginWrapper function prop to include the file for those features before the react-fullpage component mounted.
State
The wrapper maintains state in accordance to the latest version of fullpage.js callbacks
The most recent callback event that triggered a state change will be available as state.lastEvent
NOTE: if the v2 prop is passed, state will be mapped to v2 callbacks
Props
You can use any options supported by fullPage.js library as react props.
Props object can contain standard options as well as fullPage.js callbacks.
Example
More on callbacks here
Methods
fullPage.js contains many methods.
You can use any of them. These are made available as properties on the imported fullpage.js library once the first render has occured.
Callbacks
Each callback name passed to the component will maintain state itself and this will be reflected via the render prop
Callback parameters and the latest callback fired by fullpage.js will be reflected in state.
Styles
All fullpage.js styles are loaded from the component via a <style/> tag created with javascript. To override fullpage.js styles you must match specificity. Example here in the overrides.css file
Contributing
Found an issue? Have an idea? Check out the Contributing guide and open a PR
Resources
Wordpress theme
CSS Easing Animation Tool - Matthew Lein (useful to define the easingcss3 value)
alvarotrigo/react-fullpage có 1.3k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/alvarotrigo/react-fullpage. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
alvarotrigo/react-fullpage có phải mã nguồn mở không?
Có — alvarotrigo/react-fullpage phát hành theo license GPL-3.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/alvarotrigo/react-fullpage.
alvarotrigo/react-fullpage có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho alvarotrigo/react-fullpage. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
alvarotrigo/react-fullpage còn đang phát triển không?
Commit gần nhất trên alvarotrigo/react-fullpage là 1.3 năm trước (theo timestamp GitHub). Repo có 172 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Cùng nhóm Frontend còn repo nào?
alvarotrigo/react-fullpage thuộc nhóm Frontend trên TopGit, cùng 12 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về alvarotrigo/react-fullpage ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/alvarotrigo/react-fullpage là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về react-fullpage?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về react-fullpage.