Skip to content

Lruihao/stack-sticky

Repository files navigation

stack-sticky

Auto-stack position: sticky elements across nested scroll containers.

Install

npm install stack-sticky

Usage

import { stackSticky } from 'stack-sticky'

stackSticky()

stackSticky({
  type: 'top',
  root: document,
  selector: '.position-sticky:visible, .sticky-top:visible',
  offset: 0
})

API

stackSticky(options?)

  • type: 'top' | 'bottom' | 'left' | 'right', default 'top'
  • root: string | ParentNode, default document
  • selector: string, default .position-sticky:visible, .sticky-top:visible
  • offset: number, default 0

Development

pnpm install
pnpm dev
pnpm build
pnpm build:demo
pnpm lint
pnpm check

Demo Build

pnpm build:demo
pnpm preview

Publish

pnpm login
pnpm build
pnpm publish --access public

About

Auto-stack position sticky elements across nested scroll containers.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors