Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tomleb3/react-headband
A controller for your document titles
https://github.com/tomleb3/react-headband
controller document headband npm npm-module npm-package react react-headband title
Last synced: 5 days ago
JSON representation
A controller for your document titles
- Host: GitHub
- URL: https://github.com/tomleb3/react-headband
- Owner: tomleb3
- Created: 2022-03-28T19:08:51.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-08-19T12:46:52.000Z (over 2 years ago)
- Last Synced: 2024-12-29T22:49:57.712Z (about 1 month ago)
- Topics: controller, document, headband, npm, npm-module, npm-package, react, react-headband, title
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/react-headband
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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 (
);
}
```## Notes
- To avoid mismatch between titles and routes, make sure to use Headband on all routes.
## License
MIT © [tomleb3](https://github.com/tomleb3)