Skip to content

ScrollList Horizontal Scroll List

A horizontal scroll list component that supports custom list items, footer slot, load more, and more.

Platform Compatibility

App(vue)App(nvue)H5Mini Programs

Code Examples

Basic Usage

Pass a list array. Horizontal scrolling is enabled by default.

html
<see-scroll-list :list="['Recommend', 'Hot', 'Follow', 'Tech', 'Finance']">
  <template #item="{ item }">
    <view class="scroll-item">
      <text>{{ item }}</text>
    </view>
  </template>
</see-scroll-list>

Custom Item Style

Use item-gap to set spacing between items, combined with the custom slot for personalized styling.

html
<see-scroll-list :list="list" item-gap="24rpx">
  <template #item="{ item }">
    <view class="custom-item" :style="{ backgroundColor: item.color }">
      <text>{{ item.label }}</text>
    </view>
  </template>
</see-scroll-list>

Use the footer slot to add trailing content such as a "Show More" button.

html
<see-scroll-list :list="list">
  <template #item="{ item }">
    <view class="scroll-item">
      <text>{{ item }}</text>
    </view>
  </template>
  <template #footer>
    <view @click="handleMore">
      <text>Show More ></text>
    </view>
  </template>
</see-scroll-list>

Load More

Listen to the onScrollToLower event to implement load-more functionality.

html
<see-scroll-list :list="list" @on-scroll-to-lower="onLoadMore">
  <template #item="{ item }">
    <view class="scroll-item">
      <text>{{ item.title }}</text>
    </view>
  </template>
</see-scroll-list>
javascript
const onLoadMore = () => {
  // Load more data
  list.value.push(...newData)
}

Vertical Scrolling

Set scroll-x to false and scroll-y to true to switch to vertical scrolling mode.

html
<see-scroll-list :list="list" :scroll-x="false" :scroll-y="true" style="height: 300rpx;">
  <template #item="{ item }">
    <view class="scroll-item">
      <text>{{ item }}</text>
    </view>
  </template>
</see-scroll-list>

API

Props

ParameterDescriptionTypeDefaultOptions
listData listany[][]-
scroll-xEnable horizontal scrollingbooleantruetrue / false
scroll-yEnable vertical scrollingbooleanfalsetrue / false
show-scrollbarShow scrollbarbooleanfalsetrue / false
is-animatedEnable scroll animationbooleantruetrue / false
padding-leftLeft paddingstring'30rpx'-
item-gapGap between list itemsstring'20rpx'-
load-more-thresholdDistance threshold for triggering load more (px)number50-

Events

Event NameDescriptionCallback Parameters
onScrollEmitted when scrollingevent: any - Scroll event object
onScrollToLowerEmitted when scrolled to the bottom/right-
onScrollToUpperEmitted when scrolled to the top/left-

Slots

Slot NameDescriptionSlot Parameters
itemCustom list item content{ item: any, index: number }
footerFooter content-

Liao ICP No. 2025070134