
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
A React scroll rig for custom scroll bar styles and controlled scrolling state.
A React scroll rig for custom scroll bar styles and controlled scrolling state.
Install the package:
npm add scroll-rig
Basic Example
A callback with the state object to do something with
<ScrollRig
// Do something when the scroll updates
onScrollUpdate={(state) => console.log(state.progress.y)}
>
components...
</ScrollRig>
API Example
Usage of the API via a ref. Call methods or read state from the API of the ScrollRig
.
function Example() {
const scrollRef = React.useRef();
React.useEffect(() => {
scrollRef.current.update();
}, []);
return (
<ScrollRig
ref={scrollRef}
// Do something when the scroll updates
onScrollUpdate={(state) => console.log(state.progress.y)}
>
components...
</ScrollRig>
);
}
Important
Make sure the parent element for the
ScrollRig
hasoverflow: hidden
on it or theScrollRig
won't work
Prop | Type | Default | Description |
---|---|---|---|
onScrollUpdate | (state) => {} | undefined | Callback for every scroll event with current scroll state |
native | boolean | false | When true will switch to the native browser scroll |
scrollBarSize | string | 15px | Size of the scrollbars |
classNamePrefix | string | scroll-rig | Prefix for the classes on the scroll elements |
controlled | boolean | false | If true will disable scroll until api.update() is called |
Prop | Type | Description |
---|---|---|
update | () => {} | Update the scroll |
onScroll | (fn) => {} | Callback function executed on every scroll event |
state | object | State of the scroll rig |
Install and run the development server:
npm install
npm start
FAQs
A React scroll rig for custom scroll bar styles and controlled scrolling state.
The npm package scroll-rig receives a total of 4 weekly downloads. As such, scroll-rig popularity was classified as not popular.
We found that scroll-rig demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.