Skip to content

Scroll Area

Free

A box that scrolls natively with thin scrollbars of its own and optional edge fades.

  • Base UI
  • React 19
  • Tailwind CSS 4

Added Nov 8, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Set a height on the root, put the content in the viewport, and add the scrollbar with its thumb.

release-notes.tsx

ScrollAreaRoot

<div>
PropTypeDefaultDescription
classNamestring—
focusRing"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
overflowEdgeThreshold0The 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>
PropTypeDefaultDescription
classNamestring—
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>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ScrollBar

<div>
PropTypeDefaultDescription
classNamestring—
thumbPropsScrollAreaThumbProps—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.
keepMountedbooleanfalseWhether 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>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ScrollAreaCorner

<div>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ScrollArea

<div>
PropTypeDefaultDescription
classNamestring—
focusRing"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.
fadebooleanfalseFade the edges where content is hidden, on the axes of scrollbars. Off by default.
viewportPropsOmit<ScrollAreaViewportProps, "fade">—
contentPropsScrollAreaContentProps—
scrollbarProps—Props of both scrollbars. The thumb takes thumbProps, so it has one place to set it.
thumbPropsScrollAreaThumbProps—
cornerPropsScrollAreaCornerProps—
From Base UIScrollArea.RootBase UI docs
overflowEdgeThreshold0The 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.
  • Set the size on the root: h-72, max-h-60, or w-80.
  • Use scrollbars for vertical, horizontal, or both.
  • Use fade for a soft edge where content is hidden.
TabMoves focus to the box when it scrolls.
Arrow keysorPage UporPage DownScroll the focused box.

The box takes the focus only when it scrolls.

The ring draws on the root, so a fade never covers it.

  1. AddedScroll Area.
Open the release