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

importcjj/react-affix

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published