5.1.0 • Published 5 years ago
@orcden/od-top-button v5.1.0
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-buttonUsage
import '@orcden/od-top-button';<od-top-button offset=5></od-top-button>Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
offset | Number | 1 | In pixels. Set to change how far down the page the user has to scroll before the button is active. |
active | Boolean | false | Controls CSS to show/hide the button. Setting offset to 0 sets the button to always active. |
Functions
| Name | Parameters | Description |
|---|---|---|
toTop | None | Scrolls the users screen to the top. |
Styling
- CSS variables are available to alter the default styling provided
| Shadow Parts | Description |
|---|---|
| button | The html button used inside the component |
Development
Run development server and show demo
npm run demoRun linter
npm run lintFix linter errors
npm run fixRun tests
npm run testBuild for production
npm run build5.0.3
5 years ago
5.1.0
5 years ago
5.0.2
5 years ago
5.0.1
6 years ago
5.0.0
6 years ago
4.1.10
6 years ago
4.1.9
6 years ago
4.1.8
6 years ago
4.1.7
6 years ago
4.1.6
6 years ago
4.1.5
6 years ago
4.1.2
6 years ago
4.1.1
6 years ago
4.1.0
6 years ago
4.0.1
7 years ago
4.0.0
7 years ago
3.0.2
7 years ago
3.0.1
7 years ago
3.0.0
7 years ago