Sticky Section Header
This package exports 2 components. StickySectionHeader
is a light weight simmple to use component. Just wrap your headers/section headers inside StickySectionHeader
component and provide top (top position - margin from top of viewport) and viewPort (The container element, by default the browser viewport).
CollapsibleStickySectionHeader
adds on to the capabilities of StickySectionHeader
. (See below...)
Updates:
StickySectionHeader
andCollapsibleStickySectionHeader
components now set an attributestuck
when header is stuck.
Installation
Install StickySectionHeader from npm registry using one of the following
yarn add @mayank1513/sticky-section-header
npm i @mayank1513/sticky-section-header
pnpm i @mayank1513/sticky-section-header
Simple usage
My Awesome Header
import { StickySectionHeader } from "@mayank1513/sticky-section-header";
export default function YourComponent() {
return (
My Awesome Header
);
}