Skip to content
This repository was archived by the owner on Apr 16, 2020. It is now read-only.

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-affixed

live-demo

Install

npm install react-affixed

Usage

import React, { Component } from 'react';
import Affix from 'react-affixed';

const Demo = props => {
    return (
        <div>
            <Affix offsetTop={0}>
                <h1>hello, react-affixed</h1>
            </Affix>
        </div>
    )
}

props 可控属性

horizontal

bool 被固定时是否可以左右滑动 default: true

offsetTop

number 固定触发距离 default: 0

onChange

func 触发固定或者固定取消时的回调函数 default: function(){}

container

react element 固定元素所属容器 default: document.body

About

A simple react affix component(Deprecated, use sticky instead)

Topics

Resources

Stars

15 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages