# react-headband

> A simple controller for your document titles

Latest version **1.1.3** (published 2022-08-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-headband
pnpm add react-headband
yarn add react-headband
bun add react-headband
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2022-08-19 |
| First published | 2022-03-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | tomleb3 |
| Maintainers | tomleb |
| Keywords | react, headband, document, title, controller |

## Links

- npm: https://www.npmjs.com/package/react-headband
- Repository: https://github.com/tomleb3/react-headband
- Homepage: https://github.com/tomleb3/react-headband#readme
- Issues: https://github.com/tomleb3/react-headband/issues
- npm.io page: https://npm.io/package/react-headband

## 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.1.3 (latest) — 2022-08-19
- 1.1.2 — 2022-04-04
- 1.1.1 — 2022-04-03
- 1.1.0 — 2022-04-02
- 1.0.9 — 2022-04-02
- 1.0.8 — 2022-04-02
- 1.0.7 — 2022-04-02
- 1.0.6 — 2022-04-02
- 1.0.5 — 2022-04-02
- 1.0.4 — 2022-04-02
- 1.0.3 — 2022-03-31
- 1.0.2 — 2022-03-31
- 1.0.1 — 2022-03-29
- 1.0.0 — 2022-03-29

## README

# react-headband

> A simple controller for your document titles

[![NPM](https://img.shields.io/npm/v/react-headband.svg)](https://www.npmjs.com/package/react-headband) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save react-headband
```

## Description

`react-headband` is a lightweight, zero-dependency package that allows you to easily set your document's titles for different routes.

## Usage

In-order to use `react-headband`, simply import it into your project, then wrap each route declaration with Headband, while setting the desired title as a parameter.

You can add the optional `scrollToTop` parameter if you wish for that behavior when navigating to the route.

**Example:**

```tsx
import React from "react";

import Headband from "react-headband";

import Page1 from "pages/page1";
import Page2 from "pages/page2";

function App() {
  return (
    <Headband title="Page no. 1">
      <Page1 />
    </Headband>
    <Headband title="Page no. 2" scrollToTop>
      <Page2 />
    </Headband>
  );
}
```

## Notes

- To avoid mismatch between titles and routes, make sure to use Headband on all routes.

## License

MIT © [tomleb3](https://github.com/tomleb3)

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