### Install handy-scroll via npm Source: https://github.com/amphiluke/handy-scroll/blob/master/README.md Install the package as a dependency in projects using a bundler. ```shell npm install handy-scroll ``` -------------------------------- ### Import handy-scroll via HTML module Source: https://github.com/amphiluke/handy-scroll/blob/master/README.md Include the component directly in HTML files without a bundler. ```html ``` -------------------------------- ### Import handy-scroll Source: https://github.com/amphiluke/handy-scroll/blob/master/README.md Import the component for use in projects with bundlers or via ES modules. ```javascript import "handy-scroll"; ``` ```javascript import "https://esm.run/handy-scroll"; ``` -------------------------------- ### Implement standard handy-scroll Source: https://github.com/amphiluke/handy-scroll/blob/master/README.md Attach the scrollbar to a container using the owner attribute to link the scrollable element. ```html
``` -------------------------------- ### Implement handy-scroll with custom viewport Source: https://github.com/amphiluke/handy-scroll/blob/master/README.md Use the viewport attribute to attach the scrollbar to a specific scrollable container instead of the browser window. ```html
``` -------------------------------- ### HTML Attributes Source: https://github.com/amphiluke/handy-scroll/blob/master/README.md Configuration attributes for the custom element. ```APIDOC ## Attributes ### owner - **Type**: string - **Description**: The `id` of the horizontally-scrollable container that the scrollbar should control. ### viewport - **Type**: string - **Description**: Optional. The `id` of a custom element serving as the viewport. If provided, the scrollbar will stick to the bottom of this element instead of the browser window. ``` -------------------------------- ### Update handy-scroll programmatically Source: https://github.com/amphiluke/handy-scroll/blob/master/README.md Manually trigger a component update after DOM changes. ```javascript document.getElementById("my-handy-scroll").update(); ``` -------------------------------- ### HandyScroll.prototype.update() Source: https://github.com/amphiluke/handy-scroll/blob/master/README.md Triggers a manual update of the component's size, position, and visibility. This is useful when DOM changes occur that affect the owner's metrics. ```APIDOC ## HandyScroll.prototype.update() ### Description Manually triggers an update of the handy-scroll component to sync its size, position, and visibility with the owner container's metrics. ### Usage ```javascript document.getElementById("my-handy-scroll").update(); ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.