ScrollPanel
NewKeep rich content within reach, in a scrollable space that fits your layout.
Basic
Scroll with a wheel or touch, drag the thumb, or focus a scrollbar and use the arrow keys.
Custom and dynamic
Change the scrollbar colors with CSS tokens. Add content to see the thumb update automatically.
Horizontal and vertical
A wide board can overflow in both directions. Each scrollbar controls its own axis.
Usage and API
Import AvScrollPanel from avero-ui and set a height for the scrollable area.
HTML
<av-scroll-panel inputId="notes" ariaLabel="Project notes"
style="width: 100%; height: 280px">
<p>Your content goes here.</p>
</av-scroll-panel>Content. Supply a unique inputId and an ariaLabel or ariaLabelledBy. Content is projected normally. Resize and content observers update the scrollbars automatically. Call refresh() after external layout changes that are not observed, such as changing the inherited text direction.
Control. scrollTo(options) accepts native ScrollToOptions, including top, left and behavior. Smooth scrolling respects reduced-motion preferences. onScroll emits originalEvent, scrollTop and scrollLeft in pixels. Horizontal coordinates follow browser conventions, including negative left values in RTL.
Keyboard. Focus the viewport for native scrolling, or a scrollbar for arrows, PageUp/PageDown and Home/End. step sets the arrow increment in pixels (default 40). Customize horizontalLabel and verticalLabel for accessible scrollbar names.
Styling. Use --av-scroll-panel-bar-size, --av-scroll-panel-bar-radius, --av-scroll-panel-track-background, --av-scroll-panel-bar-background, --av-scroll-panel-bar-hover and --av-scroll-panel-focus. Space for both tracks is reserved to avoid layout shifts.