Skip to content

KBacktop

A button to back to top.

Install

bash
pnpm add @ikun-ui/backtop
bash
yarn add @ikun-ui/backtop
bash
npm install @ikun-ui/backtop

Basic usage

Scroll down to see the bottom-right button.

Slot Render

Render custom content via slots.

Backtop Props

NameTypeDefaultDescription
rightnumber40Distance from the right side of the screen.
bottomnumber40Distance from the bottom of the screen.
showHeightnumber200Scroll to this height to show the Backtop component.
targetstring-Scroll target element id
easingstringquartOutAnimation during back to top(TODO)
durationnumber500Time spent back to top.
clsstring''Additional class for component
attrsRecord<string, string>{}Additional attributes

Backtop Events

NameDescriptionType
clicktrigger when backtop click.(event: MouseEvent)=> void

Backtop Slots

NameDescription
defaultCustomize default content

MIT Licensed