Surfaces
Glass Scroll Area
A scrolling region with a slim glass bar that appears only when you need it.
Preview
Installation
Install the package once, then import the parts you use into a standalone component.
Install
npm install ngx-vitreo @angular/cdk @floating-ui/domImport
import { GlassScrollArea } from 'ngx-vitreo';
@Component({
imports: [GlassScrollArea],
// ...
})Usage
Usage
<glass-panel class="cpreview-scroll" variant="card">
<glass-scroll-area
class="cpreview-scroll-area"
type="auto"
viewportLabel="Release notes"
viewportRole="region"
[viewportTabindex]="0"
>
<ul class="cpreview-scroll-list" role="list">
@for (note of notes; track note.title) {
<li>
<strong>{{ note.title }}</strong>
<span>{{ note.detail }}</span>
</li>
}
</ul>
</glass-scroll-area>
</glass-panel>API reference
GlassScrollArea
glass-scroll-area
| Input | Type | Default | Description |
|---|---|---|---|
scrollbars | 'vertical' | 'horizontal' | 'both' | 'vertical' | Which scrollbars to draw. |
type | 'hover' | 'scroll' | 'auto' | 'always' | 'hover' | When a scrollbar shows: on hover and while scrolling, only while scrolling, whenever the content overflows, or always. |
scrollHideDelay | number | 600 | Milliseconds a scrollbar stays after the pointer leaves or scrolling stops. |
viewportLabel / viewportRole / viewportTabindex | string / string / number | None | aria-label, role and tabindex of the element that scrolls. Pass region, a label and 0 when the content holds no links or controls. |
viewportId / viewportClass | string | None | id and classes of the element that scrolls. |