Skip to content

Sticky

Fix an element at a specified position when the page scrolls, commonly used for navigation bars, title bars, etc.

Platform Compatibility

App(vue)App(nvue)H5Mini Programs

Code Examples

Basic Usage

html
<see-sticky>
  <view>Sticky content</view>
</see-sticky>

Custom Offset Distance

html
<see-sticky :offset-top="50">
  <view>Stick at 50px from top</view>
</see-sticky>

API

Props

PropertyDescriptionTypeDefaultOptions
offset-topDistance from top when sticky (px)number0-
z-indexz-indexnumber99-
is-enabledWhether to enable stickybooleantruetrue / false
containerContainer selectorstring--

Events

Event NameDescriptionCallback Parameters
onScrollTriggered on scroll{ isFixed: boolean, scrollTop: number }

Slots

NameDescription
defaultSticky content

Liao ICP No. 2025070134