@schibstedspain/sui-sticky-content

1.4.0 • Public • Published

StickyContent

Just a wrapper to set a position "fixed" or position "sticky" (relative until component is out of view when scrolling, and then fixed) to your component.

Installation

$ npm install @schibstedspain/sui-sticky-content --save

Usage

Basic usage

import StickyContent from '@schibstedspain/sui-sticky-content'

return (
  <div>
    <StickyContent
      sticky
      scrollingElement={document.body}
      position='top'>
      <span>Sticky content: when document.body.scrollTop is higher than components top position, this text will be fixed to top.</span>
    </StickyContent>

    <StickyContent
      fixed
      fullWidth
      position='bottom'>
      <span>Fixed content: position will be fixed to bottom</span>
    </StickyContent>
  </div>
)

Find full description and more examples in the demo page.

Readme

Keywords

none

Package Sidebar

Install

npm i @schibstedspain/sui-sticky-content

Weekly Downloads

4

Version

1.4.0

License

MIT

Unpacked Size

11.3 kB

Total Files

7

Last publish

Collaborators

  • schibstedspain