Components / Layout

ScrollArea

A styled native scrolling viewport with reactive edge state.

Preview

Activity

Today

AM

Ana moved “Research” to In review

1 min ago

MP

Mina uploaded user-flow.fig

2 mins ago

JB

Jon commented on API handoff

3 mins ago

YO

You completed Design QA

4 mins ago

AM

Ana invited Louis to the project

5 mins ago

MP

Mina archived Sprint 18

6 mins ago

Use cases

Activity feed

Constrain a long list inside a dashboard panel.

Horizontal gallery

Keep a strip of wide cards scrollable on small screens.

Usage example

Vue
<ScrollArea class="h-48">
  <ScrollAreaViewport>
    <div class="h-96">Scrollable content</div>
  </ScrollAreaViewport>
</ScrollArea>

More examples

Activity feed

The viewport preserves native scrolling behavior.

Activity feed
<script setup lang="ts">
import ScrollArea from './components/ui/scroll-area/ScrollArea.vue'
import ScrollAreaViewport from './components/ui/scroll-area/ScrollAreaViewport.vue'
const events = ['Created workspace', 'Invited Ada', 'Published report', 'Updated billing']
</script>

<template>
  <ScrollArea class="h-48"><ScrollAreaViewport aria-label="Recent activity"><ul><li v-for="event in events" :key="event">{{ event }}</li></ul></ScrollAreaViewport></ScrollArea>
</template>

Horizontal card strip

Choose horizontal orientation for wide content.

Horizontal card strip
<script setup lang="ts">
import ScrollArea from './components/ui/scroll-area/ScrollArea.vue'
import ScrollAreaViewport from './components/ui/scroll-area/ScrollAreaViewport.vue'
</script>

<template>
  <ScrollArea orientation="horizontal" class="w-full"><ScrollAreaViewport aria-label="Featured projects">
    <div class="flex w-max gap-4"><article v-for="n in 6" :key="n" class="w-48">Project {{ n }}</article></div>
  </ScrollAreaViewport></ScrollArea>
</template>

Key API

The most useful props, models, slots, events, and methods for this component.

Key API for ScrollArea
NameTypeDefault or requirement
orientationvertical | horizontal | bothvertical

Native wheel, touch, keyboard, and momentum scrolling are preserved. The root exposes viewport, edges, and scrollTo().

Implementation notes

  • Give the root an actual height or width constraint so overflow can occur.
  • Use the exposed viewport and edge state when you need programmatic scrolling or fade affordances.

Accessibility and localization

  • Native wheel, touch, and keyboard scrolling remain available; name a scrollable region when its purpose is unclear.
Weini UIDesign system · Vue component library · Free and public