@solid-primitives/scroll

Primitive to manage scrolling

Usage no npm install needed!

<script type="module">
  import solidPrimitivesScroll from 'https://cdn.skypack.dev/@solid-primitives/scroll';
</script>

README

@solid-primitives/scroll

lerna size size stage

Helpful primitives to manage browser scrolling.

createScrollObserver - Helpful monitor that reports the current position of an element or window.

Installation

npm install @solid-primitives/scroll
# or
yarn add @solid-primitives/scroll

How to use it

const position = createScrollObserver();

or

let ref;
const position = createScrollObserver(() => ref);

Demo

You may view a working example here: https://codesandbox.io/s/solid-primitives-scroll-csg7f

Primitive ideas:

createScrollTo - A primitive to support scroll to a target createHashScroll - A primitive to support scrolling based on a hashtag change

Changelog

Expand Changelog

0.0.100

Initial porting of the scroll primitive.

1.0.4

Released new version with CJS and SSR support.

1.0.5

Updated to Solid 1.3