Security News
npm Updates Search Experience with New Objective Sorting Options
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
@studio-freight/react-lenis
Advanced tools
[![Bibliotheca](https://assets.studiofreight.com/bibliotheca/header.png)](https://github.com/studio-freight/bibliotheca)
react-lenis creates and manages an instance of the Lenis. It takes in a root prop and an options object that is spread into the Lenis constructor.
If root
is true, <ReactLenis>
will be the root Lenis instance and all other <ReactLenis>
components in the app will get the instance from the context. If root
is false, the component will create a new Lenis instance and provide it via the context. It's recommended to only have one <ReactLenis root>
component in your app.
const Layout = () => {
return (
<ReactLenis root options={{ ...options }}>
{/* Your scrollable website */}
</ReactLenis>
)
}
The options
object is passed directly to the Lenis instance, check their readme for reference
Once the Lenis context is set (components mounted inside <ReactLenis>
) you can use these handy hooks:
useScroll
is a hook that listens to scroll events from the Lenis instance.
The hook takes two arguments:
useLenis
is a hook that returns the Lenis instance, either from the context or the root instance, depending on the value of root.
The hook takes one argument:
microbundle
after running build:bundled
script. Includes all external dependencies.microbundle
after running build:dist
script.
tsc
after running build:types
script.vite
through dev
script to serve the documentation.This tool is maintained by the Studio Freight Darkroom team:
FAQs
![NPM Version](https://img.shields.io/npm/v/%40studio-freight%2Freact-lenis?colorA=000000&colorB=ff98a2) ![NPM Downloads](https://img.shields.io/npm/dm/%40studio-freight%2Freact-lenis?colorA=000000&colorB=ff98a2)
The npm package @studio-freight/react-lenis receives a total of 7,566 weekly downloads. As such, @studio-freight/react-lenis popularity was classified as popular.
We found that @studio-freight/react-lenis demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers 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
npm has a revamped search experience with new, more transparent sorting options—Relevance, Downloads, Dependents, and Publish Date.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.