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
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
Programmatic scroll & events
idle · atBottom: true
API reference
hb-scroll-area
| Property | Description | Type | Default |
|---|---|---|---|
| [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 | — |