Skip to content

ScrollbarHelper Service documentation

import { ScrollbarHelper } from '@siemens/element-ng/common';

Gets the width of the scrollbar. Nesc for windows http://stackoverflow.com/a/13382873/888165

Deprecated: This service uses a legacy DOM-measurement hack to determine scrollbar width. Use element.offsetWidth - element.clientWidth on the scrollable element directly, which is more accurate, SSR-safe, and accounts for OS-level theming and CSS overrides. Will be removed in v52.

Attributes and Methods

NameTypeDefaultDescription
(readonly) width
number this.getWidth()

The width of the scrollbar.


Except where otherwise noted, content on this site is licensed under MIT License.