Set a height on the root, put the content in the viewport, and add the scrollbar with its thumb.
release-notes.tsx
ScrollAreaRoot
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| focus | "inset""outside" | "outside" | Where the focus ring sits when the Viewport has keyboard focus: outside (default) or inset, for a Scroll Area in a parent that clips or with a sticky child (scrollFocusVariants in #/lib/scroll-focus). |
From Base UIScrollArea.RootBase UI docs | |||
| overflow | 0 | The threshold in pixels that must be passed before the overflow edge attributes are applied. Accepts a single number for all edges or an object to configure them individually. | |
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
ScrollAreaViewport
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| fade | "both""horizontal""none""vertical" | — | Fade the edges where content is hidden. Off by default. It adds almost nothing while scrolling (against 1.6 ms without it); the cost of a Scroll Area is Base UI updating its own state on each scroll frame, with or without the fade. |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
ScrollAreaContent
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
ScrollBar
<div>| Prop | Type | Default | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | ||||||||
| thumb | ScrollAreaThumbProps | — | Props of the thumb inside. A className here adds to the component classes. | |||||||
From Base UIScrollArea.ScrollbarBase UI docs | ||||||||||
| orientation | "horizontal""vertical" | "vertical" | Whether the scrollbar controls vertical or horizontal scroll. | |||||||
| keep | boolean | false | Whether to keep the HTML element in the DOM when the viewport isn't scrollable. | |||||||
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | ||||||||
| ||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | |||||||
ScrollAreaThumb
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
ScrollAreaCorner
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
ScrollArea
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
| focus | "inset""outside" | — | Where the focus ring sits when the Viewport has keyboard focus: outside (default) or inset, for a Scroll Area in a parent that clips or with a sticky child (scrollFocusVariants in #/lib/scroll-focus). |
| scrollbars | "both""horizontal""vertical" | "vertical" | The scrollbars to show. both also adds the Corner. |
| fade | boolean | false | Fade the edges where content is hidden, on the axes of scrollbars. Off by default. |
| viewport | Omit<ScrollAreaViewportProps, "fade"> | — | |
| content | ScrollAreaContentProps | — | |
| scrollbar | — | Props of both scrollbars. The thumb takes thumbProps, so it has one place to set it. | |
| thumb | ScrollAreaThumbProps | — | |
| corner | ScrollAreaCornerProps | — | |
From Base UIScrollArea.RootBase UI docs | |||
| overflow | 0 | The threshold in pixels that must be passed before the overflow edge attributes are applied. Accepts a single number for all edges or an object to configure them individually. | |
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
| Tab | Moves focus to the box when it scrolls. |
|---|---|
| Arrow keysorPage UporPage Down | Scroll the focused box. |



