Component

Scroll area

A scroll container with a custom overlay scrollbar. Scroll vertically, horizontally, or both; choose when the bar appears; size and colour the thumb; fade the edges; and scroll or read position through the exposed instance.

Vertical & edge fade

Autumn photo #1
Autumn photo #2
Autumn photo #3
Autumn photo #4
Autumn photo #5
Autumn photo #6
Autumn photo #7
Autumn photo #8
Autumn photo #9
Autumn photo #10
Autumn photo #11
Autumn photo #12
Autumn photo #13
Autumn photo #14
Autumn photo #15
Autumn photo #16
Autumn photo #17
Autumn photo #18
Autumn photo #19
Autumn photo #20
import { ChangeDetectionStrategy, Component } from '@angular/core';

import { HbScrollAreaImports } from '@herbst/ui';

@Component({
  selector: 'hb-demo-scroll-area-basic',
  imports: [HbScrollAreaImports],
  template: `
    <hb-scroll-area hbFade class="h-64 w-full max-w-xs rounded-md border border-border">
      <div class="flex flex-col gap-2 p-4">
        @for (n of items; track n) {
          <div class="rounded-md border border-border px-3 py-2 text-sm">Autumn photo #{{ n }}</div>
        }
      </div>
    </hb-scroll-area>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class HbDemoScrollAreaBasicComponent {
  protected readonly items = Array.from({ length: 20 }, (_, i) => i + 1);
}

Horizontal, always-on & styled

Plate 1
Plate 2
Plate 3
Plate 4
Plate 5
Plate 6
Plate 7
Plate 8
Plate 9
Plate 10

Programmatic scroll & events

Entry 1
Entry 2
Entry 3
Entry 4
Entry 5
Entry 6
Entry 7
Entry 8
Entry 9
Entry 10
Entry 11
Entry 12
Entry 13
Entry 14
Entry 15
Entry 16
Entry 17
Entry 18
Entry 19
Entry 20
Entry 21
Entry 22
Entry 23
Entry 24

idle · atBottom: true

API reference

hb-scroll-area

PropertyDescriptionTypeDefault
[hbOrientation] Which axes scroll. The area needs a constrained height and/or width. 'vertical' | 'horizontal' | 'both' 'vertical'
[hbType] When the scrollbar shows: on hover, while scrolling, always, or auto (whenever content overflows). 'hover' | 'scroll' | 'always' | 'auto' 'hover'
[hbHideDelay] For type "scroll", the delay in milliseconds before the bar fades after scrolling stops. number 600
[hbFade] Fade the content out at the edges you can scroll toward. boolean false
[hbSize] / [hbVariant] Scrollbar thickness, and the thumb colour treatment. 'sm' | 'md' | 'lg' / 'default' | 'subtle' | 'solid' 'md' / 'default'
(hbReachEnd) Emits "bottom" or "right" when the content is scrolled to that edge — handy for infinite loading. 'bottom' | 'right'
exportAs "hbScrollArea" Reference it to call scrollToTop(), scrollToBottom(), scrollTo({ top, left }), and read the atTop(), atBottom(), atStart(), atEnd() signals. methods / signals