# single-page-scrolling-navigation

> Single page scrolling navigation

Latest version **1.2.5** (published 2024-02-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install single-page-scrolling-navigation
pnpm add single-page-scrolling-navigation
yarn add single-page-scrolling-navigation
bun add single-page-scrolling-navigation
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.5 |
| Published | 2024-02-13 |
| First published | 2023-05-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Christian Montenegro |
| Maintainers | christianmo |
| Keywords | react, landing page, scrolling navigation |

## Links

- npm: https://www.npmjs.com/package/single-page-scrolling-navigation
- Repository: https://github.com/Christianmo/single-page-scrolling-navigation
- Homepage: https://github.com/Christianmo/single-page-scrolling-navigation#readme
- Issues: https://github.com/Christianmo/single-page-scrolling-navigation/issues
- npm.io page: https://npm.io/package/single-page-scrolling-navigation

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.2.5 (latest) — 2024-02-13
- 1.2.4 — 2024-02-13
- 1.2.3 — 2024-02-12
- 1.2.2 — 2024-02-12
- 1.2.1 — 2024-02-12
- 1.2.0 — 2024-02-12
- 1.0.1 — 2023-05-12
- 1.0.0 — 2023-05-12

## README

## CMO Single page scrolling navigation

Small library to handle scroll navigation on one page websites

### Install

```
npm install single-page-scrolling-navigation
```

```javascript
import { singlePageNavigation } from "single-page-scrolling-navigation";
```

### Setting

#### ReactJS:

```javascript
useEffect(() => {
  singlePageNavigation({
    selector: ".nav",
    childSelector: ".nav li a",
    time: 2000,
    easing: "easeInOutQuad",
    cb: () => console.log("animation finished"),
  });
}, []);
```

```html
<nav className="nav">
  <ul>
    <li>
      <a href="#about">About</a>
    </li>
    <li>
      <a href="#services">Services</a>
    </li>
    <li>
      <a href="#work">Work</a>
    </li>
    <li>
      <a href="#contact">Contact</a>
    </li>
  </ul>
</nav>
```

#### HTML and VanillaJs:

```javascript
cmoHashNavigation({
  selector: ".nav",
  childSelector: ".nav li a",
  time: 2000,
  easing: "easeInOutQuad",
  cb: () => console.log("animation finished"),
});
```

```html
<nav class="nav">
  <ul>
    <li>
      <a href="#about">About</a>
    </li>
    <li>
      <a href="#services">Services</a>
    </li>
    <li>
      <a href="#work">Work</a>
    </li>
    <li>
      <a href="#contact">Contact</a>
    </li>
  </ul>
</nav>
```

### Options

| Option        | Type     | Default | Description                                                                                                                                                                                   |
| ------------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| selector      | string   | null    | the selector, it could be a class, id, or tagname                                                                                                                                             |
| childSelector | string   | null    | the child selector, it could be a class, id, or tagname                                                                                                                                       |
| time          | integer  | null    | the animation duration                                                                                                                                                                        |
| cb            | function | null    | callback to execute when animation finish                                                                                                                                                     |
| easing        | string   | null    | could be one of these easeInQuad, easeOutQuad, easeInOutQuad, easeInCubic, easeOutCubic, easeInOutCubic, easeInQuart, easeOutQuart, aseInOutQuart, easeInQuint, easeOutQuint, easeInOutQuint. |

---
_Source: https://npm.io/package/single-page-scrolling-navigation · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
