# react-composable-title

> Composable interface to document.title

Latest version **1.0.0** (published 2016-10-20) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-10-20 |
| First published | 2016-09-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Justin Falcone |
| Maintainers | modernserf |

## Links

- npm: https://www.npmjs.com/package/react-composable-title
- npm.io page: https://npm.io/package/react-composable-title

## Recent versions

- 1.0.0 (latest) — 2016-10-20
- 0.1.1 — 2016-09-20

## README

# react-composable-title
---

This is a reinterpretation of [react-document-title](https://github.com/gaearon/react-document-title) with some added notions of "composability," inspired by [React Router v4](https://react-router.now.sh/), and uses Redux under the hood.

## Installation

`npm install react-composable-title react redux react-redux`

## Example

```js
import React from "react"
import { Match } from "react-router"
import { Title, TitleProvider } from "react-composable-title"

function App () {
    return (
        <TitleProvider>
            <Title title={(child) =>
                child ? `${child} | My Cool App` : "My Cool App"
            }/>
                <div>
                    <Match exactly pattern="/" component={Home} />
                    <Match pattern="/foo" component={Foo} />
                    <Match pattern="/bar/:id" component={Bar} />
                </div>
            </Title>
        </TitleProvider>
    )
}

function Home () {
    return <div>Home Page</div>
}

function Foo () {
    return <Title title="Foo">
        Foo page
    </Title>
}

function Bar ({ params }) {
    return <Title title={`Bar ${params.id}`}>
        Bar page
    </Title>
}

```

### Results

- `/` : "My Cool App"
- `/foo` : "Foo | My Cool App"
- `/bar/20` : "Bar 20 | My Cool App"

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