Talisman LogoTalisman Logo Design System
Browse documentation
Components

Scroll area

A region with its own vertical scroll and a styled scrollbar, for long lists inside a fixed-height container.

Stableimport { ScrollArea } from "@repo/ui/scroll-area";Source

Petição inicial recebida

Documentos classificados

Contestação gerada

Enviada para revisão

Comentário de Marina Costa

Devolvida para ajustes

Argumentos de defesa atualizados

Revisão aprovada

Protocolo agendado

Protocolada no tribunal

Aguardando réplica

Réplica recebida

type
<ScrollArea type="hover" />

When to use

  • A long list or log inside a panel that must keep its size, such as the history of a process.
  • A side panel or popup whose content can outgrow the available height.
  • A block that scrolls on its own while the rest of the page stays still.

When not to use

  • The whole page. Let the page scroll. Nested scroll regions trap the wheel and the keyboard.
  • Lists the user searches. Use Command or Combobox, which carry their own scroll.
  • Tables with a sticky header. Use Table and its container.
  • Two panels the user resizes. Use Resizable.

Examples

Default

The scrollbar appears while the pointer is over the area. Give the area a height (h-64), otherwise it grows with its content and never scrolls.

Petição inicial recebida

Documentos classificados

Contestação gerada

Enviada para revisão

Comentário de Marina Costa

Devolvida para ajustes

Argumentos de defesa atualizados

Revisão aprovada

Protocolo agendado

Protocolada no tribunal

Aguardando réplica

Réplica recebida

Always visible

type="always" keeps the bar on screen, so people see at once that there is more to read. Prefer it for lists the user must go through to the end.

Petição inicial recebida

Documentos classificados

Contestação gerada

Enviada para revisão

Comentário de Marina Costa

Devolvida para ajustes

Argumentos de defesa atualizados

Revisão aprovada

Protocolo agendado

Protocolada no tribunal

Aguardando réplica

Réplica recebida

type The scrollbar shows
hover Default. While the pointer is over the area.
scroll While scrolling, then hides after scrollHideDelay.
auto Only when the content overflows.
always Always.

Content

  • Cut the content at a natural point: the last visible row is half hidden, which tells people there is more.
  • Keep the first rows the ones people need most.
  • Say how much there is when you can: “12 eventos”.

Do and don’t

Petição inicial recebida

Documentos classificados

Contestação gerada

Enviada para revisão

Comentário de Marina Costa

Devolvida para ajustes

Argumentos de defesa atualizados

Revisão aprovada

Protocolo agendado

Protocolada no tribunal

Aguardando réplica

Réplica recebida

DoGive the area a height that shows several rows and hints at the rest.

Petição inicial recebida

Documentos classificados

Contestação gerada

Enviada para revisão

Comentário de Marina Costa

Devolvida para ajustes

Argumentos de defesa atualizados

Revisão aprovada

Protocolo agendado

Protocolada no tribunal

Aguardando réplica

Réplica recebida

Don'tDon't make the area so short that it shows one row. People scroll a window instead of reading.

Accessibility

  • Built on Radix Scroll Area. The viewport is a native scrolling element, so the mouse wheel, touch and trackpad work as usual.
  • Keyboard scrolling works when focus is inside the area, for example on a link or a button in it. Arrow keys, PageUp, PageDown, Home and End scroll the viewport.
  • The viewport is not focusable by itself, and ScrollArea does not let you give it a tabindex. When the content has no focusable element, keyboard users cannot scroll it. Put a focusable item in the content, or use a different pattern.

Code

import { ScrollArea } from "@repo/ui/scroll-area";

<ScrollArea className="h-64 w-80 rounded-lg border border-primary">
  {events.map((event) => (
    <p key={event.id}>{event.label}</p>
  ))}
</ScrollArea>;

Props

ScrollArea
PropTypeDefaultDescription
scrollHideDelayunknown600Milliseconds before the scrollbar hides, when `type` is `hover` or `scroll`
type"auto" | "always" | "hover" | "scroll"hoverWhen the scrollbar shows: on hover, while scrolling, only when content overflows, or always
ScrollBar
PropTypeDefaultDescription
orientation"vertical" | "horizontal""vertical"Which axis the bar controls. `ScrollArea` already renders the vertical one.

Known issues

Issue Effect
The viewport has no tabindex and ScrollArea forwards props to the root only. A region with text only cannot be scrolled with the keyboard. This breaks keyboard access (WCAG 2.1.1) in that case.
The thumb uses bg-stroke-secondary, a 10% opacity color. The thumb is almost invisible on a light background, which makes it hard to see where you are in the list.
The scrollbar is 10px wide (w-2.5). Below the 24px minimum hit target. Hard to grab with a mouse.
ScrollArea renders only the vertical ScrollBar. Content wider than the area has no styled horizontal bar unless the app also mounts ScrollBar orientation="horizontal".
Edit this page on GitHub