smooth-motion
Version:
React smooth scroll and animation component powered by Framer Motion. Lightweight, fluid, customizable, TypeScript-ready, and perfect for modern web apps and UI design.
129 lines (90 loc) โข 3.38 kB
Markdown
# smooth-motion
[](https://www.npmjs.com/package/smooth-motion)
[](https://www.npmjs.com/package/smooth-motion)
[](https://www.typescriptlang.org/)
[](LICENSE)
**Author:** Thinakaran Manokaran ยท [https://thinakaran.dev](https://thinakaran.dev)
## ๐ Overview
**smooth-motion** is a **lightweight React smooth scroll component** powered by **Lenis**.
It enables **fluid, speed-controllable scroll effects** with zero external CSS, working seamlessly in both **JavaScript (JSX)** and **TypeScript (TSX)** projects.
Ideal for **modern UI/UX**, landing pages, portfolios, and apps that need **silky smooth scrolling animations** with minimal setup.
## โจ Features
* ๐ Smooth **Lenis-powered scroll animations**
* โก **Lightweight** and dependency-friendly
* ๐ง Fully **customizable** via props (`speed`)
* ๐ฆ Out-of-the-box support for **JSX & TSX**
* ๐จ No extra CSS โ just clean, declarative **React**
* ๐ก๏ธ TypeScript typings included
## ๐ฆ Installation
Install with your favorite package manager:
```bash
npm install smooth-motion
# or
yarn add smooth-motion
# or
pnpm add smooth-motion
```
## ๐ Usage Examples
### JavaScript (JSX)
```jsx
import React from "react";
import { UseSmoothScroll } from "smooth-motion";
export default function App() {
return (
<>
<UseSmoothScroll speed={1.5} />
<div style={{ height: 3000 }}>
<h1>Hello from UseSmoothScroll (JSX)</h1>
</div>
</>
);
}
```
### TypeScript (TSX)
```tsx
import React from "react";
import { UseSmoothScroll } from "smooth-motion";
const App: React.FC = () => {
return (
<>
<UseSmoothScroll speed={2} />
<div style={{ height: 3000 }}>
<h1>Hello from UseSmoothScroll (TSX)</h1>
</div>
</>
);
};
export default App;
```
## โ๏ธ Props
| Prop | Type | Default | Description |
| ------- | -------- | ------- | --------------------------------------- |
| `speed` | `number` | `1` | Controls scroll speed (higher = faster) |
## ๐ก Why Choose smooth-motion?
* Works with **React 17+ and React 19**
* **TypeScript-ready** โ zero config required
* Minimal footprint, fast performance
* Perfect for **landing pages, portfolios, and apps**
* Designed for **developers who love smooth UI animations**
โ
One package, dual compatibility, zero friction.
## ๐ ๏ธ Development & Contribution
1. Clone the repo
2. Install dependencies: `npm install`
3. Build the package: `npm run build`
4. Test locally via `npm link` or `npm pack`
5. Open an issue or PR to contribute ๐
## ๐ License
This project is licensed under the **MIT License** โ see the [LICENSE](LICENSE) file.
## ๐ Links
* ๐ Author Website: [https://thinakaran.dev](https://thinakaran.dev)
* ๐ฆ npm: [smooth-motion](https://www.npmjs.com/package/smooth-motion)
* ๐ป GitHub Repo: [UseSmoothScroll](https://github.com/thinakaranmanokaran/SmoothScroll)