Overlay Scrollbar
<dsx-overlay-scrollbar> — Overlay Scrollbar
Section titled “<dsx-overlay-scrollbar> — Overlay Scrollbar”Scrollable container with custom scrollbar styling for vertical, horizontal, or bidirectional overflow.
Live Preview
Import
Section titled “Import”import '@bnotk/dsx/components/overlay-scrollbar.js';<dsx-overlay-scrollbar direction="vertical" style="height: 12rem;"> <div style="height: 24rem">Tall content</div></dsx-overlay-scrollbar>Elements
Section titled “Elements”<dsx-overlay-scrollbar>
Section titled “<dsx-overlay-scrollbar>”Thin wrapper around a scrollable inner div that receives the default slot.
Properties
Section titled “Properties”| Property | Type | Default | Description |
|---|---|---|---|
| direction | ’vertical’ | ‘horizontal’ | ‘both' | 'both’ | Constrains overflow direction on the internal scroller. |
Methods
Section titled “Methods”None.
Events
Section titled “Events”None.
| Slot | Description |
|---|---|
| default | Scrollable content projected inside the inner .scroller div. |
CSS Parts
Section titled “CSS Parts”| Part | Description |
|---|---|
| scroller | Inner scrollable element that owns the native scrollbars. |
- Firefox scrollbar styling is provided with
scrollbar-widthandscrollbar-color. - WebKit scrollbars are customized with
::-webkit-scrollbar*selectors.
Behavior Notes
Section titled “Behavior Notes”- The host itself hides overflow and the inner
.scrollertakesheight: 100%. - Horizontal mode disables vertical scrolling; vertical mode disables horizontal scrolling;
bothleaves both directions enabled.
Styling Notes
Section titled “Styling Notes”- Scrollbar size is controlled by
--ds2-scrollbar-size. - Thumbs use
--ds2-color-grey-3and lighten on hover.