Skip to content

Search documentation

Search guides, examples, and component APIs.

Quick links
↑↓ NavigateEnter OpenEsc Close
Get started

Documentation navigation

Components / Layout

ScrollArea

A styled native scrolling viewport with reactive edge state.

Last changed in version 0.13.0: Add avatar groups and chips, expand the block gallery, and improve component colors, spacing, and motion.

Interactive showcase

Activity

Today

Ana moved “Research” to In review

1 min ago

Mina uploaded user-flow.fig

2 mins ago

Jon commented on API handoff

3 mins ago

You completed Design QA

4 mins ago

Ana invited Louis to the project

5 mins ago

Mina archived Sprint 18

6 mins ago

Install

Run in your project
bunx --bun @getweini/cli@latest add scroll-area

Start with this example

Import the files copied by the install command, then place the component in your Vue template. The text and values in the example belong to your app; change them to fit your task.

  • Created workspace
  • Invited Ada
  • Published report
  • Updated billing
Vue
<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>

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

When to use it

Activity feed

Constrain a long list inside a dashboard panel.

Horizontal gallery

Keep a strip of wide cards scrollable on small screens.

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&nbsp;{{ n }}</article>
      </div>
    </ScrollAreaViewport>
  </ScrollArea>
</template>

Complete API

Every public prop, model, event, slot, and exposed member of the installed Vue parts is listed below. “Not set” means you can leave that value out; “Required” means you must provide it. Native HTML attributes also work where the component uses a native element.

ScrollArea

Complete API for ScrollArea
NameType or signatureDefaultWhat it does
orientationpropScrollAreaOrientation | undefined"vertical"Arrange items horizontally or vertically.
defaultslot(props: { edges: ScrollAreaEdges; }) => unknownRequiredContent shown inside ScrollArea.
viewportexposedHTMLElement | null—Access viewport from a component template ref.
edgesexposed{ top: boolean; right: boolean; bottom: boolean; left: boolean; start: boolean; end: boolean; }—Access edges from a component template ref.
scrollToexposed(options: ScrollToOptions) => void—Access scroll to from a component template ref.

ScrollAreaViewport

Complete API for ScrollAreaViewport
NameType or signatureDefaultWhat it does
defaultslot(props: { edges: ScrollAreaEdges; }) => unknownRequiredContent shown inside ScrollAreaViewport.
elementexposedHTMLElement | null—Reference to the underlying HTML element.
edgesexposedScrollAreaEdges—Access edges from a component template ref.
scrollToexposed(options: ScrollToOptions) => void | undefined—Access scroll to from a component template ref.
Public type definitions
Public types
// packages/frameworks/vue/components/scroll-area/types.ts
// ------- TYPES -------

export type ScrollAreaOrientation = 'vertical' | 'horizontal' | 'both'

export interface ScrollAreaEdges {
  top: boolean
  right: boolean
  bottom: boolean
  left: boolean
  start: boolean
  end: boolean
}

export interface ScrollAreaProps {
  orientation?: ScrollAreaOrientation
}

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.

Source contract and editing guidance