Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-scroll-sticky

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-scroll-sticky

react scroll sticky like 'side bar: about' in fb profile home

  • 1.1.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-scroll-sticky

Made with create-react-library

NPM JavaScript Style Guide

Install

npm install --save react-scroll-sticky

Usage

//
const App = () => {
  //
  const { calculateAgain, ref_main_elm, ref_sticky_elm, ref_fake_elm } =
    useScrollSticky({
      sticky_location: /./,
      header_head: 0,
      detectInnerWidthIsOk: detectInnerWidthIsOk
    })

  //
  React.useEffect(() => {
    calculateAgain()
  }, [calculateAgain])

  // ----

  //
  function detectInnerWidthIsOk() {
    return true
  }

  //
  return (
    <div className={styles.main}>
      <div className={styles.row}>
        <div className={`${styles.left}`}>
          <ScrollSticky
            ref_main_elm={ref_main_elm}
            ref_fake_elm={ref_fake_elm}
            ref_sticky_elm={ref_sticky_elm}
          >
            <div className={styles.preview}>
              <div>1</div>

              <div>2</div>

              <div>3</div>

              <div>4</div>
            </div>
          </ScrollSticky>
        </div>

        <div className={`${styles.right}`}></div>
      </div>
    </div>
  )
}

License

MIT ©

FAQs

Package last updated on 02 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc