dzh-react-sticky

React中固钉(粘性布局)组件实现

Usage no npm install needed!

<script type="module">
  import dzhReactSticky from 'https://cdn.skypack.dev/dzh-react-sticky';
</script>

README

dzh-react-sticky

React中固钉(粘性布局)组件实现

Prop Types

Property Type Required? Description
contentHeight Number 被固钉组件包裹起来的内容高度

How To Use

import React, { Component } from 'react'
import { Sticky } from 'dzh-react-sticky'

class Example extends Component {
    render()(
      return <div>
        ...
        <Sticky contentHeight={40}>
            {% 被固钉组件包裹起来的子组件 %}
            <Filter />
        </Sticky>
        ...
      </div>
    )
}

License

dzh-react-sticky is available under the MIT License.