All Projects → nihgwu → stickyard

nihgwu / stickyard

Licence: MIT license
Make your React component sticky the easy way

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to stickyard

Vue2 Datatable
The best Datatable for Vue.js 2.x which never sucks. Give us a star 🌟 if you like it! (DEPRECATED. As I, @kenberkeley, the only maintainer, no longer works for OneWay. Bugs may be fixed but new features or breaking changes might not be merged. However, it's still the best in my mind because of its extremely flexible usage of dynamic components)
Stars: ✭ 867 (+944.58%)
Mutual labels:  sticky
React Virtualized Sticky Tree
A React component for efficiently rendering tree like structures with support for position: sticky
Stars: ✭ 115 (+38.55%)
Mutual labels:  sticky
Stickybits
Stickybits is a lightweight alternative to `position: sticky` polyfills 🍬
Stars: ✭ 2,220 (+2574.7%)
Mutual labels:  sticky
Zebra pin
A lightweight jQuery plugin for creating sticky elements pinned to the page or to a container element
Stars: ✭ 56 (-32.53%)
Mutual labels:  sticky
Consecutivescroller
ConsecutiveScrollerLayout是Android下支持多个滑动布局(RecyclerView、WebView、ScrollView等)和普通控件(TextView、ImageView、LinearLayou、自定义View等)持续连贯滑动的容器,它使所有的子View像一个整体一样连续顺畅滑动。并且支持布局吸顶功能。
Stars: ✭ 1,383 (+1566.27%)
Mutual labels:  sticky
React Native Keyboard Accessory View
Keyboard accessory (sticky) view for your React Native app. Supports interactive dismiss on iOS.
Stars: ✭ 128 (+54.22%)
Mutual labels:  sticky
Stickyswitch
⭐️ beautiful switch widget with sticky animation ⭐️
Stars: ✭ 725 (+773.49%)
Mutual labels:  sticky
reason-epitath
CPS sugar usage for React Render Props composition in ReasonML
Stars: ✭ 16 (-80.72%)
Mutual labels:  render-props
Unix Permissions
Swiss Army knife for Unix permissions
Stars: ✭ 106 (+27.71%)
Mutual labels:  sticky
Flutter sticky infinite list
Multi directional infinite list with Sticky headers for Flutter applications
Stars: ✭ 189 (+127.71%)
Mutual labels:  sticky
Groupedrecyclerviewadapter
GroupedRecyclerViewAdapter可以很方便的实现RecyclerView的分组显示,并且每个组都可以包含组头、组尾和子项;可以方便实现多种Type类型的列表,可以实现如QQ联系人的列表一样的列表展开收起功能,还可以实现头部悬浮吸顶功能等。
Stars: ✭ 1,163 (+1301.2%)
Mutual labels:  sticky
Ngx Scrollspy
Angular ScrollSpy Service
Stars: ✭ 94 (+13.25%)
Mutual labels:  sticky
Vue Sticky
Stars: ✭ 161 (+93.98%)
Mutual labels:  sticky
Floatsidebar.js
Lightweight (2kb gzipped), zero-dependency javascript library for making float sidebars based on the finite state machine
Stars: ✭ 56 (-32.53%)
Mutual labels:  sticky
Sticky Layoutmanager
An android recyclerview sticky item view layout manager library
Stars: ✭ 252 (+203.61%)
Mutual labels:  sticky
Ng Sticky
Angular 4 sticky, have header or any component sticky easy to use.
Stars: ✭ 25 (-69.88%)
Mutual labels:  sticky
Fixed Sticky
DEPRECATED: A position: sticky polyfill that works with filamentgroup/fixed-fixed for a safer position:fixed fallback.
Stars: ✭ 1,490 (+1695.18%)
Mutual labels:  sticky
render-props
㸚 Easy-to-use React state containers which utilize the render props (function as child) pattern
Stars: ✭ 33 (-60.24%)
Mutual labels:  render-props
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 (+39.76%)
Mutual labels:  sticky
Stickyfloat
This plugin makes it possible to have a fixed position element that is relative to it’s parent. A normal fixed positioned element would be “out of context” and is very difficult to use in the most common situations with fluid designs. This plugin solves that problem with as little code as I could possible get it so it will run in the most optimized way, while also allow you to customize it in many important ways which might suit you best.
Stars: ✭ 166 (+100%)
Mutual labels:  sticky

Stickyard

Make your React component sticky the easy way, using render prop https://nihgwu.github.io/stickyard/

Install

# Yarn
yarn add stickyard

# NPM
npm install --save stickyard

Props

children

function({}) | required

Render whatever you want, it's called with an object with the following properties:

  • registerContainer(ref), pass to the container's ref prop.
  • registerSticky(ref), pass to the ref prop of whatever node within the container if you want to make it sticky.
  • updateState(), update the sticky state manually, this useful if your content is resizable.
  • getStickyOffsets(), return all the sticky-able elements' offsets.
  • scrollToIndex(index), scroll to the specific sticky element by index.
  • scrollTo(offset), scroll to the specific offset.

The ref-register must be passed to the real DOM node, so if the component is a wrapper uppon DOM node, you need to register it to the underlying DOM node, using innerRef or something like that if provided.

stickyClassName

string

The className to be attached to the element when it's sticky.

This feature relies on classList which is not supported below IE10, so it won't take any effect on IE9 or below, you can use onSticky to implement by yourself.

onSticky

function(index)

It's called when an element becomes sticky, -1 means there is no sticky element.

Usage

import Stickyard from 'stickyard'

// pseudo code
<Stickyard>
  {({ registerContainer, registerSticky }) => (
    <div ref={registerContainer}>
      {items.map((item, index) => (
        <div key={item.key} ref={item.sticky ? registerSticky : null}>
          {item.label}
        </div>
      ))}
    </div>
  )}
</Stickyard>

License

MIT © Neo

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].