GithubHelp home page GithubHelp logo

czmavi / stickypanel Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 112 KB

React component for a side panel that sticks on users screen.

License: MIT License

JavaScript 100.00%
javascript react reactjs layout

stickypanel's Introduction

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

Name Mandatory Default value Description
childSelector Yes Is used to get reference of the provided child component that should be sticky
active No True Enable or disable sticky functionality
mediaQuery No When provided stickyness will only work when the media query results to true. For example it can be used to disable sticky behavior on mobile.
containerClass No Class that will be added to the container of provided child elements
topSpace No 0 Top spacing. Should be used if there is something like fixed position menu bar on the top of the page
bottomSpace No 0 Same as top spacing just on the bottom

stickypanel's People

Contributors

czmavi avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.