5.1.0 • Published 4 years ago

@orcden/od-top-button v5.1.0

Weekly downloads
1
License
MIT
Repository
bitbucket
Last release
4 years ago

Button to scroll the user's screen to the top.

<od-top-button> is a simple button that will show and hide, based on a givin screen offset. When clicked the screen will scroll to the top. By default it has an offset of 1px.

Installation

  • Install with npm
npm i @orcden/od-top-button

Usage

import '@orcden/od-top-button';
<od-top-button offset=5></od-top-button>

Attributes

AttributeTypeDefaultDescription
offsetNumber1In pixels. Set to change how far down the page the user has to scroll before the button is active.
activeBooleanfalseControls CSS to show/hide the button. Setting offset to 0 sets the button to always active.

Functions

NameParametersDescription
toTopNoneScrolls the users screen to the top.

Styling

  • CSS variables are available to alter the default styling provided
Shadow PartsDescription
buttonThe html button used inside the component

Development

Run development server and show demo

npm run demo

Run linter

npm run lint

Fix linter errors

npm run fix

Run tests

npm run test

Build for production

npm run build
5.0.3

4 years ago

5.1.0

4 years ago

5.0.2

4 years ago

5.0.1

4 years ago

5.0.0

4 years ago

4.1.10

4 years ago

4.1.9

4 years ago

4.1.8

4 years ago

4.1.7

4 years ago

4.1.6

4 years ago

4.1.5

4 years ago

4.1.2

5 years ago

4.1.1

5 years ago

4.1.0

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago