KBacktop
A button to back to top.
Install
bash
pnpm add @ikun-ui/backtopbash
yarn add @ikun-ui/backtopbash
npm install @ikun-ui/backtopBasic usage
Scroll down to see the bottom-right button.
Slot Render
Render custom content via slots.
Backtop Props
| Name | Type | Default | Description |
|---|---|---|---|
| right | number | 40 | Distance from the right side of the screen. |
| bottom | number | 40 | Distance from the bottom of the screen. |
| showHeight | number | 200 | Scroll to this height to show the Backtop component. |
| target | string | - | Scroll target element id |
| easing | string | quartOut | Animation during back to top(TODO) |
| duration | number | 500 | Time spent back to top. |
| cls | string | '' | Additional class for component |
| attrs | Record<string, string> | {} | Additional attributes |
Backtop Events
| Name | Description | Type |
|---|---|---|
| click | trigger when backtop click. | (event: MouseEvent)=> void |
Backtop Slots
| Name | Description |
|---|---|
| default | Customize default content |