Skip to content

Scroll Area ​

Loading...

<flint-scroll-bar> ​

Custom overlay scrollbar. Place inside flint-scroll-area with slot="scrollbar" for an explicit horizontal or second-axis bar. The parent flint-scroll-area calls setThumb() and setVisible() to keep this element in sync with the viewport's scroll position.

  • Tag: <flint-scroll-bar>
  • Class: FlintScrollBar

Import ​

ts
import 'flint-ui'; // auto-registers all
// or
import { FlintScrollBar } from 'flint-ui';

Usage ​

html
<flint-scroll-bar></flint-scroll-bar>

Properties ​

PropertyAttributeTypeDefaultDescription
orientationorientation'vertical' | 'horizontal''vertical'Which axis this scrollbar controls. Reflects to attribute.

Slots ​

NameDescription
—none (fully shadow DOM)

CSS Custom Properties ​

PropertyDefault
--flint-scrollbar-track-colortransparent
--flint-scrollbar-thumb-radius9999px
--flint-scrollbar-size8px
--flint-scrollbar-thumb-colorrgba(0, 0, 0, 0.35
--flint-scrollbar-thumb-hover-colorrgba(0, 0, 0, 0.5

Methods ​

MethodDescription
setThumb(pos: number, size: number)Push updated thumb geometry from the parent scroll area.
setVisible(visible: boolean)Show or hide the scrollbar (parent controls visibility).

<flint-scroll-area> ​

  • Tag: <flint-scroll-area>
  • Class: FlintScrollArea

Import ​

ts
import 'flint-ui'; // auto-registers all
// or
import { FlintScrollArea } from 'flint-ui';

Usage ​

html
<flint-scroll-area></flint-scroll-area>

Properties ​

PropertyAttributeTypeDefaultDescription
typetype'auto' | 'always' | 'scroll' | 'hover''hover'Controls when the scrollbars appear. - 'hover' (default) — on hover, when content overflows - 'auto' — when content overflows - 'always' — always - 'scroll' — briefly while scrolling
dirdir'ltr' | 'rtl''ltr'Text direction. 'rtl' flips the vertical bar to the left side.

Slots ​

NameDescription
(default)Default slot for content
scrollbar

Methods ​

MethodDescription
scrollTo(optionsOrX?: ScrollToOptions | number, y?: number)
scrollBy(optionsOrX?: ScrollToOptions | number, y?: number)