1.0.1 • Published 5 years ago

sticky-panel v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Sticky side panel component

Sticky side panel, that will float in it's container attempting to be always visible. See demo.

Instalation

You can install it via NPM npm i sticky-panel

Usage

First import it import StickyPanel from 'sticky-panel'

Then put it into your component render method

Minimum required parameters is just childSelector which is used to get reference of the child component that should be sticky.

<StickyPanel containerClass="side-1" childSelector=".sticky-panel">
  <div className="sticky-panel">
    <p>
      Sticky side panel
    </p>
  </div>
</StickyPanel>

Parameters

NameMandatoryDefault valueDescription
childSelectorYesIs used to get reference of the provided child component that should be sticky
activeNoTrueEnable or disable sticky functionality
mediaQueryNoWhen provided stickyness will only work when the media query results to true. For example it can be used to disable sticky behavior on mobile.
containerClassNoClass that will be added to the container of provided child elements
topSpaceNo0Top spacing. Should be used if there is something like fixed position menu bar on the top of the page
bottomSpaceNo0Same as top spacing just on the bottom