How to Use React Sticky Sidebar?

Create a react sticky sidebar and make your website more beautiful!

Create a Component

import StickyBox from "react-sticky-box";
 
const StickySidebar = () => {
    return (
        <>
            <div className="row">
                <StickyBox offsetTop={20} offsetBottom={20}>
                  <div>Sidebar</div>
                </StickyBox>
                <div>Content</div>
            </div>
        </>
    );
}

export default StickySidebar;

More info https://www.npmjs.com/package/react-sticky-box

Leave a Reply

Your email address will not be published.