npm

svelte-smooth-scroll
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

svelte-smooth-scroll

Simple Svelte Smooth Scroll inspired by valmisson/svelte-scrolling

Usage

<button on:click={() => scrollTo('section-1')}> Go to 1</button>
<button on:click={() => scrollTo('section-2')}> Go to 2</button>
<button on:click={() => scrollTo(section3)}> Go to 3</button>

<div use:smoothScroll={'section-1'}>
	<h1>Section 1</h1>
</div>
<div id="section-2" use:smoothScroll>
	<h1>Section 2</h1>
</div>
<div bind:this={section3}>
	<h1>Section 3</h1>
</div>

Readme

Keywords

none

Package Sidebar

Install

npm i svelte-smooth-scroll

Weekly Downloads

1

Version

1.0.2

License

none

Unpacked Size

4.71 kB

Total Files

12

Last publish

Collaborators

  • fenwikk
  • youknowedo