Layout & structure
Layout
ScrollArea
A scroll box with slim, themed scrollbars and faded edges, in one or both directions. Use it for panels and lists that scroll inside the page.
Install
import { ScrollArea } from 'vael-ui'Playground
vertical
Placement, behaviour and animation
Usage
<script setup lang="ts">
import { ScrollArea } from 'vael-ui'
</script>
<template>
<ScrollArea>
<ul>
<li v-for="n in 20" :key="n">Item {{ n }}</li>
</ul>
</ScrollArea>
</template>Motion New
ScrollArea: its appearance.
<ScrollArea
:motion="{ initial: { root: { opacity: 0, y: 4 } } }"
/>| Name | Type | Description |
|---|---|---|
initialexit | root | Sets where each part comes in from and leaves to: any CSS property, plus x, y and blur. A plain number is px, or degrees for rotate. |
enterleave | (parts, context) => animation | Animates the parts with GSAP, motion or element.animate(). Return the animation and the component waits for it, and stops it if interrupted. |
springdurationeasing | { damping, response } | number | string | Times all of it: a spring, or a duration in ms with an easing. Never both. |
false | boolean | Turns its motion off, for an animation of your own on its exposed elements. |
Accessibility
It has no keyboard interaction of its own.
- The viewport is a native scroller with a native scrollbar, so the browser handles scrolling keys once focus is inside it.
- While the content overflows and holds nothing focusable, the viewport gets
tabindex="0", so you can reach it with Tab. aria-labelandaria-labelledbygo on the viewport, which then becomes arole="region". Other attributes go on the root.