Skip to content

KAffix

Avatars can be used to represent people or objects. It supports images, Icons, or characters.

Install

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

Basic usage

Affix has trigger-top, top, trigger-bottom and bottom. trigger-top is top affixing trigger point. top is the style top value after top affixing is trigger. trigger-bottom and bottom work in similar way.

Position

Affix can be absoluteor fixed positioned. You may need some css tricks to make it works as following.

Affix Props

NameTypeDefaultDescription
topnumber-The css top property after trigger top affix. (if not set, use trigger-top prop).
triggerTopnumber-The distance px to top of target to trigger top affix. (if not set, use top prop).
bottomnumber-The css bottom property after trigger bottom affix. (if not set, use trigger-bottom prop).
triggerBottomnumber-The distance px to bottom of target to trigger bottom affix. (if not set, use bottom prop).
positionOption'fixed' | 'absolute'fixedCSS position of the affix.
listenTostring | ScrollTarget | (() => HTMLElement)documentThe scrolling element to listen scrolling.
clsstring''Additional class for component
attrsRecord<string, string>{}Additional attributes

Affix Slots

NameDescription
defaultCustomize default content

MIT Licensed