Scroll Area
A container that scrolls its content in one or both directions, with a thin scrollbar in the theme's colors.
<arc-scroll-area>Overview
ScrollArea wraps content that might outgrow its space, like a sidebar list, a modal body or a dropdown, and scrolls it with a thin scrollbar: a border-bright thumb on a surface-overlay track.
orientation picks the direction. vertical is the default and hides horizontal overflow. horizontal does the reverse, for galleries or wide code blocks, and both scrolls both ways, for data grids. max-height takes any CSS length and caps the height so the content scrolls.
The container is a focusable role="region" labelled "Scrollable content", so keyboard users can Tab to it and scroll with the arrow keys. It inherits the host's border-radius, and scroll-behavior is smooth.
Guidelines
Do
- Set `max-height` inside fixed-height layouts like sidebars, modals and dropdowns
- Give the area a border or background so people can see where it ends
- Keep `orientation="both"` for content that really is two-dimensional, like a data grid
Don't
- Don't nest scroll areas. The wheel scrolls the inner one until it hits its end, then the outer one
- Don't set a `max-height` so small that most of the content is hidden with nothing to say it's there
- Don't use it for the main page scroll. Let the page scroll itself
Features
- Parts: `base` and `scroll-area`, both on the scrolling element
Preview
Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8: the last line.
Usage
<arc-scroll-area max-height="300px">
<p>Your scrollable content here...</p>
<!-- More content that exceeds 300px height -->
</arc-scroll-area>import { ScrollArea } from '@arclux/arc-ui-react';
export default function Example() {
return (
<ScrollArea maxHeight="300px">
<p>Your scrollable content here...</p>
{/* More content that exceeds 300px height */}
</ScrollArea>
);
}<script setup>
import { ScrollArea } from '@arclux/arc-ui-vue';
</script>
<template>
<ScrollArea max-height="300px">
<p>Your scrollable content here...</p>
<!-- More content that exceeds 300px height -->
</ScrollArea>
</template><script>
import { ScrollArea } from '@arclux/arc-ui-svelte';
</script>
<ScrollArea max-height="300px">
<p>Your scrollable content here...</p>
<!-- More content that exceeds 300px height -->
</ScrollArea>import { Component } from '@angular/core';
import { ScrollArea } from '@arclux/arc-ui-angular';
@Component({
imports: [ScrollArea],
template: `
<arc-scroll-area max-height="300px">
<p>Your scrollable content here...</p>
<!-- More content that exceeds 300px height -->
</arc-scroll-area>
`,
})
export class MyComponent {}import { ScrollArea } from '@arclux/arc-ui-solid';
export default function Example() {
return (
<ScrollArea maxHeight="300px">
<p>Your scrollable content here...</p>
{/* More content that exceeds 300px height */}
</ScrollArea>
);
}import { ScrollArea } from '@arclux/arc-ui-preact';
export default function Example() {
return (
<ScrollArea maxHeight="300px">
<p>Your scrollable content here...</p>
{/* More content that exceeds 300px height */}
</ScrollArea>
);
}<!-- Auto-generated by @arclux/prism — do not edit manually -->
<!-- arc-scroll-area — requires scroll-area.css + tokens.css (or arc-ui.css) -->
<div class="arc-scroll-area">
<div
class="scroll-area"
tabindex="0"
role="region"
aria-label="Scrollable content"
>
ScrollArea
</div>
</div><!-- Auto-generated by @arclux/prism — do not edit manually -->
<!-- arc-scroll-area — self-contained, no external CSS needed -->
<style>
@media (prefers-reduced-motion: reduce) {
.arc-scroll-area *,
.arc-scroll-area *::before,
.arc-scroll-area *::after { animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important; }
}
.arc-scroll-area .scroll-area::-webkit-scrollbar-thumb:hover { background: rgb(110, 115, 155); }
</style>
<div class="arc-scroll-area" style="display: block; position: relative">
<div
class="scroll-area" style="overflow: hidden; scroll-behavior: smooth; border-radius: var(--radius-full); width: 6px; height: 6px; background: var(--bg-elevated); scrollbar-width: thin; scrollbar-color: var(--border-bright) var(--bg-elevated)"
tabindex="0"
role="region"
aria-label="Scrollable content"
>
ScrollArea
</div>
</div>API
max-heightstring''- CSS max-height value applied to the scrollable container. Use any valid CSS length (e.g.
300px,50vh). orientation'vertical' | 'horizontal' | 'both''vertical'- Scroll direction.
verticalshows a vertical scrollbar,horizontalshows a horizontal scrollbar,bothshows both.