Scroll Area

A native scroll viewport with slim, theme-consistent scrollbars.

<tp-scroll-area>
Scroll Area
Default density Compact density Restart from the initial state Show the copyable source

Release history

v2.4.0 · Shared workspaces
v2.3.2 · Faster search indexing
v2.3.1 · Fix CSV export encoding
v2.3.0 · Usage reports
v2.2.4 · SAML for all plans
v2.2.3 · Audit log filters
v2.2.0 · Billing self-service
v2.1.5 · Dark mode polish
v2.1.0 · Command palette
v2.0.1 · Hotfix for invite links
v2.0.0 · New editor
v1.9.0 · Comments and mentions

Usage

A Scroll Area keeps the browser’s own scrolling (wheel, touch, keyboard, focus and scroll anchoring) and replaces only the visible scrollbars. Constrain its height or width; its content decides how far it scrolls. A label names the viewport as a region, which helps when it holds a lot of content. Track clicks and drags preserve keyboard focus, temporarily suspend scroll snapping, and restore it on release, cancellation, disabling, removal or disconnection. Track wheel input leaves reached edges unconsumed for ancestor scrolling; control-wheel zoom is untouched.

Horizontal

orientation="horizontal" shows the horizontal track. The content needs an intrinsic width wider than the area, such as a row that does not wrap.

Horizontal
Default density Compact density Restart from the initial state Show the copyable source
Brand guidelines.pdf Q3 roadmap.key Pricing model.xlsx Hiring plan.docx Launch checklist.md

Both axes

axis="both" shows both tracks for content that overflows in two directions, like a wide table. The corner fills the space where the tracks meet.

Both axes
Default density Compact density Restart from the initial state Show the copyable source
Invoice Customer Issued Due Status Amount
INV-2041Northwind TradersOct 1, 2026Nov 1, 2026Open$4,820.00
INV-2040Contoso Ltd.Sep 28, 2026Oct 28, 2026Paid$1,250.00
INV-2039Fabrikam Inc.Sep 21, 2026Oct 21, 2026Paid$9,400.00
INV-2038Tailspin ToysSep 14, 2026Oct 14, 2026Overdue$615.00
INV-2037Wide World ImportersSep 7, 2026Oct 7, 2026Paid$2,180.00
INV-2036Adventure WorksAug 31, 2026Sep 30, 2026Paid$3,300.00

Scrollbar visibility

scrollbar-visibility decides when tracks appear. The default, automatic, shows each overflowing axis; on-hover and while-scrolling keep quiet surfaces clean, and always keeps the track visible as a cue that more content exists.

Visibility
Default density Compact density Restart from the initial state Show the copyable source
on-hover Ada OkaforBen CarterChloé MartinDiego AlvarezEmi TanakaFarah Haddad
always Ada OkaforBen CarterChloé MartinDiego AlvarezEmi TanakaFarah Haddad

Overflow markers

The host exposes data-overflow-y-start and data-overflow-y-end while content is hidden past an edge. Use them for fades or shadows that tell people there is more to scroll. Scroll the viewport itself with the standard scrollTo and scrollTop APIs on viewportElement. No second scroll position or component change event is maintained. Horizontal offsets follow the native RTL model.

Edge fade
Default density Compact density Restart from the initial state Show the copyable source

These terms govern your use of Tweakpad and any workspace you create or join.

You keep ownership of the content you upload. You grant us the rights needed to host and display it to the people you share it with.

Paid plans renew automatically each billing period until cancelled from the Billing page.

We may update these terms. Material changes are announced by email at least 30 days in advance.

Back to top

API Reference

Every element also accepts motion-policy.

Attributes

AttributePropertyTypeDefaultDescriptionaxisaxis'x' | 'y' | 'both' | undefined—Restricts scrolling to one axis, or shows both tracks for content that overflows both ways; takes precedence over orientation.labellabelstring''Names the viewport as a region, which helps when it holds a lot of content.scrollbar-visibilityscrollbarVisibilityScrollbarVisibility'automatic'When the tracks appear: on overflow, always, only while scrolling or only on hover.keep-mountedkeepMountedbooleanfalseKeeps a track rendered when its axis does not overflow; it stays hidden unless visibility is always.show-cornershowCornerbooleantrueRenders the corner where visible horizontal and vertical tracks meet.

Properties

PropertyTypeDefaultDescriptionscrollbarsreadonly ScrollbarOptions[] | undefined—Configures each track on its own (orientation, visibility, keep-mounted), replacing axis and orientation; an empty list keeps native scrolling with no custom tracks.overflowEdgeThresholdOverflowEdgeThreshold0How far, in pixels, content must be hidden past an edge before that edge counts as overflowing; one number or one per edge.viewportElementread-onlyHTMLElement | null—The native scrolling element, for scrollTo, scrollTop and scroll events; null before the first render.contentElementread-onlyHTMLElement | null—The element wrapping the slotted content inside the viewport; null before the first render.

Slots

SlotDescriptiondefaultThe scrolling content.

CSS parts

PartDescription::part(scroll-area)The root that positions the tracks over the viewport.::part(scroll-area-content)The wrapper of the slotted content inside the viewport.::part(scroll-area-corner)The square where a horizontal and a vertical track meet.::part(scroll-area-viewport)The native, focusable scrolling element.

Components, widgets and patterns that use this one.