Skip to content
BigBang

Popular

    ↑↓Navigate↵OpenEscClose
    TR

    Components

    ScrollArea

    A scrollable region with thin themed scrollbars and fading edges.

    Storybook
    Storybook
    Source
    Source

    ScrollArea is for content that must scroll inside a fixed-size area: a long menu in the sidebar, an activity list in a card, a horizontal strip of tags. The page layout stays put; only the area scrolls.

    • For the whole page: Let the page use the browser’s own scrolling; do not wrap the page in a ScrollArea.
    • For lists of thousands of rows: Use a virtual list; ScrollArea renders every item.
    • For short content: If the content fits, do not force the area to a fixed size.
    import { Provider, ScrollArea } from '@bigbang/ui';
    export default function Vertical() {
    return (
    <Provider locale="en-GB">
    <div className="h-60 w-72 rounded-md border border-line-subtle">
    <ScrollArea label="Item list">
    <ul className="m-0 grid list-none gap-sm px-md py-sm">
    {Array.from({ length: 20 }, (_, index) => (
    <li key={index}>List item {index + 1}</li>
    ))}
    </ul>
    </ScrollArea>
    </div>
    </Provider>
    );
    }
    1. Root: Takes the size you give it; carries the edge fade variables.
    2. Viewport: The element that scrolls; it is in the tab order and becomes a named region with label.
    3. Scrollbar: A thin track and a round thumb; drawn only when the content overflows.
    4. Edge fade: Content fades at an edge that hides more content.
    • Wheel, touch and keyboard use the browser’s native scrolling; behaviour does not change.
    • The viewport takes focus: arrow keys, Page Up, Page Down, Home, End and Space scroll it.
    • Scrollbars are hidden at rest; they appear while the pointer is over the area or it scrolls.
    • When the area reaches its end the page does not scroll (overscroll-behavior: contain).
    • An edge fades only while there is hidden content in that direction.
    • Give the area a size (className or its container); the area fills it.
    • Do not nest scrolling areas on one page.
    • Give a label that says what the area holds, especially when a page has several areas.
    • Do not put the only action at the very edge of the area; the fade can dim it.
    • label is a short noun phrase: “Activity list”, “Tags”.
    Turkish English
    Öğe listesi Item list
    Etkinlik listesi Activity list
    Etiketler Tags
    • Tabs: Long tab lists scroll sideways on their own.
    • AppShell: The sidebar menu scrolls inside a ScrollArea.
    • Accordion: Splits long content into sections instead of scrolling it.