@smashing/title

Manage page title

Usage no npm install needed!

<script type="module">
  import smashingTitle from 'https://cdn.skypack.dev/@smashing/title';
</script>

README

Title

Manage page title with React component.

yarn add @smashing/title

Change page title

This will set page title to About. If app title is configured, it will be set to About - App Title

import {Title} from "@smashing/title"

export const AboutPage = () => (
  <div>
    <Title>About</Title>
  </div>
)

Setup app title and separator

import {TitleContext} from "@smashing/title"

export const App = () => (
  <TitleContext.Provider
    value={{
      title: 'My App Name',
      separator: ' - '
    }}
  >
    {/* ... */}
  </TitleContext.Provider>
)