ScrollArea
Give the root a bounded height or width. type controls scrollbar visibility:
auto, hover, or always.
import { ScrollArea, Text } from '@manti-ui/react'; const paragraphs = [ 'Mantı is a family of dumplings found from Central Asia to Anatolia. The Turkish kind is tiny — squares of thin dough pinched around a pinch of spiced lamb or beef, then boiled.', 'They are served under a generous spoon of garlic yogurt and a drizzle of melted butter bloomed with Aleppo pepper and dried mint.', 'Rolling them small is a point of pride: the saying goes that a good cook makes mantı small enough that forty fit on a single spoon.', 'Across regions the shape shifts — boat-shaped and steamed, folded into purses, or left open at the top — but the yogurt-and-butter finish is the throughline.', 'Freeze them raw on a floured tray, then bag them; they cook straight from frozen with just an extra minute in the pot.', ]; export default function ScrollAreaBasic() { return ( <ScrollArea className="h-[calc(var(--manti-space-16)*3.25)] w-full max-w-[calc(var(--manti-space-16)*6)] border border-border rounded-md bg-surface"> <div className="grid gap-3 p-4 text-text-muted text-sm leading-normal"> {paragraphs.map((p, i) => ( <Text key={i}>{p}</Text> ))} </div> </ScrollArea> ); }
Orientation
Use vertical, horizontal, or both.
Tag 1Tag 2Tag 3Tag 4Tag 5Tag 6Tag 7Tag 8Tag 9Tag 10Tag 11Tag 12Tag 13Tag 14Tag 15Tag 16
API
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | The content to scroll. |
orientation | 'vertical' | 'horizontal' | 'both' | 'vertical' | Which axis scrolls. |
type | 'auto' | 'hover' | 'always' | 'auto' | When the thumb shows: on activity then idle-hide (auto), on hover/focus/drag (hover), or whenever content overflows (always). |
focusable | boolean | true | Make the viewport keyboard-focusable so it can be scrolled. |
Styling
Anatomy
| Part | Selector | Description |
|---|---|---|
root | [data-scope="scroll-area"][data-part="root"] | The bounded outer container. |
viewport | [data-scope="scroll-area"][data-part="viewport"] | The scrollable element (native scrollbar hidden). |
content | [data-scope="scroll-area"][data-part="content"] | The inner content wrapper. |
scrollbar | [data-scope="scroll-area"][data-part="scrollbar"] | A custom scrollbar track (one per scrolling axis). |
thumb | [data-scope="scroll-area"][data-part="thumb"] | The draggable thumb inside a scrollbar. |
Tokens
| Token | Controls |
|---|---|
--manti-scroll-area-size | size |
Last updated