All Projects → madou → react-sticky-header

madou / react-sticky-header

Licence: MIT license
🍯 A sticky header for React.js

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to react-sticky-header

react-sticky-headroom
A React Component to hide a Header using CSS sticky position
Stars: ✭ 22 (-60%)
Mutual labels:  header, sticky
Stickyheaderlistview
打造炫酷列表之 StickyHeaderListView:标题渐变、吸附悬浮、筛选分类、动态头部等
Stars: ✭ 2,820 (+5027.27%)
Mutual labels:  header, sticky
Floatthead
Fixed <thead>. Doesn't need any custom css/html. Does what position:sticky can't
Stars: ✭ 1,193 (+2069.09%)
Mutual labels:  header, sticky
React-Native-top-navbar
This reactnative package provides custom header component for mobile apps. also providing utility method to change statusbar color.
Stars: ✭ 27 (-50.91%)
Mutual labels:  header
HTML5Sticky
📌 HTML5Sticky - sticky notes app for the web !
Stars: ✭ 51 (-7.27%)
Mutual labels:  sticky
react-banner
A dynamic banner/header component.
Stars: ✭ 25 (-54.55%)
Mutual labels:  header
c2ats
generate ATS interface from C code
Stars: ✭ 19 (-65.45%)
Mutual labels:  header
flutter sticky and expandable list
粘性头部与分组列表Sliver实现 Build a grouped list, which support expand/collapse section and sticky headers, support use it with sliver widget.
Stars: ✭ 116 (+110.91%)
Mutual labels:  sticky
get header
This function is similar to the get_headers function
Stars: ✭ 35 (-36.36%)
Mutual labels:  header
GitHub-FixedHeader
Pinned header on GitHub
Stars: ✭ 63 (+14.55%)
Mutual labels:  sticky
pagination
Aplus Framework Pagination Library
Stars: ✭ 167 (+203.64%)
Mutual labels:  header
Android-sticky-navigation-layout
android sticky navigation layout
Stars: ✭ 17 (-69.09%)
Mutual labels:  sticky
vscodefileheader
VSCode File Header
Stars: ✭ 17 (-69.09%)
Mutual labels:  header
SmartStickyHeader
A Custom Header View With Multiple Items to make selection from categories
Stars: ✭ 36 (-34.55%)
Mutual labels:  sticky
http
Basic HTTP primitives which can be shared by servers and clients.
Stars: ✭ 75 (+36.36%)
Mutual labels:  header
stickyard
Make your React component sticky the easy way
Stars: ✭ 83 (+50.91%)
Mutual labels:  sticky
poop
Firefox extension that prevents sending Origin headers when they are least likely to be necessary, to protect your privacy.
Stars: ✭ 36 (-34.55%)
Mutual labels:  header
42header.vim
Add and update the 42 comment header at the top of your files
Stars: ✭ 15 (-72.73%)
Mutual labels:  header
RTHeadedColumnView
Multi-column content with a common header view
Stars: ✭ 12 (-78.18%)
Mutual labels:  header
Textylic
A note taking app developed for the 22nd century
Stars: ✭ 34 (-38.18%)
Mutual labels:  sticky

react-sticky-header

NPM version NPM downloads Build Status codecov Dependency Status

Lightweight sticky header made for React that works with both colours and images. You can see an example implementation over at Guild Wars 2 Armory.

Installation

npm install react-sticky-header

Usage

// Import the base CSS, if you're using webpack just import them straight.
// Else import them into your base CSS.
import 'react-sticky-header/styles.css';
import StickyHeader from 'react-sticky-header';

const MyHeader = () => (
  <StickyHeader
    // This is the sticky part of the header.
    header={
      <div className="Header_root">
        <h1 className="Header_title">ReactStickyHeader</h1>

        <ul className="Header_links">
          <li className="Header_link">When</li>
          <li className="Header_link">Why</li>
          <li className="Header_link">About</li>
        </ul>
      </div>
    }
  >
    <section>
      <p>
        This section will be what the sticky header scrolls over before entering into
        sticky state. See the gif above or run the test story book to see examples.
      </p>
    </section>
  </StickyHeader>
);
prop type required description
header Children yes A react element that will be the sticky part of the header.
children Children no Elements that you want to appear under the sticky header.
headerOnly boolean no Use this to force the header into "sticky" mode. It will automatically hide the children and calculate the height spacer for header.
onSticky (boolean) => void no Callback fired when the header enters/leaves sticky state. See Sticky State section.
backgroundImage string no Self explanatory.
backgroundColor string no Self explanatory.
className string no Self explanatory.
stickyOffset number no The number to offset the sticky header.

Sticky State

When the component enters sticky state, it will add a class name is-sticky to the root element of the header.

React Story Book

To run the component in various states, run the following command then go to http://localhost:6006/.

npm start

Testing

npm test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].