A box that scrolls and can take keyboard focus, so keyboard users can Tab to it and scroll with the arrow keys.
Default
A row that scrolls sideways; Tab to it and use the arrow keys.
- Brand refresh for Denzing
- Packaging for Northfield Coffee
- Website for Lumen Studio
- Annual report for Kora Bank
- Menu design for Saffron House
- App icons for Pathway
Installation
Copies the component into src/design-system/ as your own source, with only the files it needs.
npx avesk-ui@latest add scroll-areaIt needs no other component. The first time, it also adds the tokens and the cn() helper, imports the tokens in globals.css and installs clsx and tailwind-merge. Files already in your project are kept unless you add --force.
Import
Lives in src/design-system/components/scroll-area.tsx.
import { ScrollArea } from "@/design-system/components/scroll-area";Usage
<ScrollArea label="Payments" className="rounded-lg border border-black/5">
<ul className="min-w-[820px]">…</ul>
</ScrollArea>Examples
Vertical
A fixed-height list that scrolls up and down, like an activity feed.
- Maya uploaded logo v3 to Brand refresh for Denzing
- Denzing approved the colour palette
- Rohan sent Invoice #1042
- Anna commented on the packaging mockups
- Northfield Coffee asked for a second round
- Jo added a motion study to Lumen Studio
- Proposal for Kora Bank was signed
- Maya moved the type study to review
Both directions
A wide table in a short box scrolls both ways.
| Invoice | Client | Project | Issued | Due | Amount | Status |
|---|---|---|---|---|---|---|
| #1040 | Denzing | Brand refresh | 2 Nov | 16 Nov | $1,200 | Paid |
| #1041 | Northfield Coffee | Packaging | 3 Nov | 17 Nov | $1,550 | Paid |
| #1042 | Denzing | Brand refresh | 4 Nov | 18 Nov | $1,900 | Paid |
| #1043 | Northfield Coffee | Packaging | 5 Nov | 19 Nov | $2,250 | Open |
| #1044 | Denzing | Brand refresh | 6 Nov | 20 Nov | $2,600 | Open |
| #1045 | Northfield Coffee | Packaging | 7 Nov | 21 Nov | $2,950 | Open |
| #1046 | Denzing | Brand refresh | 8 Nov | 22 Nov | $3,300 | Open |
| #1047 | Northfield Coffee | Packaging | 9 Nov | 23 Nov | $3,650 | Open |
When to use
Use it when
- Wide lists or tables that scroll sideways
- Panels whose content scrolls up and down
Don’t use it when
- Data tables → TableCard (already a ScrollArea)
- Menus and listboxes that move focus between items → DropdownMenu or CommandMenu
Rules
- Never write overflow-auto on a plain div in a screen; use ScrollArea
- axis: x (default), y or both
Accessibility
- tabIndex=0 with the brand focus ring while the content overflows (WCAG 2.1.1); when everything fits it leaves the Tab order
- Give label when the content has no buttons or links: it becomes a named region
Related
Used in the Avesk app: Finance & Growth, Projects & Clients, Proposals & Scope.