# react-doc-title

> [![NPM](https://img.shields.io/npm/v/react-doc-title.svg)](https://www.npmjs.com/package/@benjick/react-doc-title) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) ![Build Status](https:

Latest version **2.0.0** (published 2020-04-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-doc-title
pnpm add react-doc-title
yarn add react-doc-title
bun add react-doc-title
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2020-04-08 |
| First published | 2019-02-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 2 |
| Unpacked size | 35.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | benjick |
| Maintainers | benjick |

## Links

- npm: https://www.npmjs.com/package/react-doc-title
- Repository: https://github.com/benjick/react-doc-title
- npm.io page: https://npm.io/package/react-doc-title

## Dependencies (2)

- [uniqid](https://npm.io/package/uniqid.md) ^5.2.0
- [constate](https://npm.io/package/constate.md) ^2.0.0

## Recent versions

- 2.0.0 (latest) — 2020-04-08
- 1.0.0 — 2019-02-11
- 0.2.0 — 2019-02-11
- 0.1.1 — 2019-02-10
- 0.1.0 — 2019-02-10

## README

# react-doc-title

[![NPM](https://img.shields.io/npm/v/react-doc-title.svg)](https://www.npmjs.com/package/@benjick/react-doc-title) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) ![Build Status](https://github.com/benjick/react-doc-title/workflows/Tests/badge.svg)

## Install

```bash
yarn add react-doc-title
```

## Usage

```js
import React from 'react'
import {Provider, Title, useTitle} from 'react-doc-title'

function MyComponent() {
  useTitle('Contact')
  return <p>Contact us</p>
}

function App() {
  return (
    <Provider title="My website">
      <Title string="About" />
      <MyComponent />
    </Provider>
  )
}
```

> Document title would be `Contact - About - My website`

### Provider
 `<Provider>` needs to wrap any `<Title>`. You can change settings here too

| prop name | type | default | misc |
| ------------- | ------------- | ------------- | ------------- |
| title | string | | |
| append | boolean | `false` | If this is set to true the example would be `My website - About - Contact` |
| divider | string | ` - ` | Change the divider between title fragments

### Title
Adds a title fragment

| prop name | type |
| ------------- | ------------- |
| string | string |


## License

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

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