Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

use-window-blur-change-title

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-window-blur-change-title

React Hook for set the page title when the user is shifting focus away from the current window.


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

npm-version npm-download

use-window-blur-change-title

React Hook for set the page title when the user is shifting focus away from the current window.

Installation

To install the hook you can use npm:

npm i use-window-blur-change-title

or Yarn if you prefer:

yarn add use-window-blur-change-title

Usage

All you need is simple import the hook:

import { useWindowBlurChangeTitle } from 'use-window-blur-change-title';

And call the hook in the body function component:

useWindowBlurChangeTitle('Hey, please come back');

The hook takes one parameter - the new document title to appear in the blur time of the window. If the user returns to the window (focus), the title will be changed to the one before the change.

Full example:

import { useWindowBlurChangeTitle } from 'use-window-blur-change-title';

export const AppComponent = () => {
  useWindowBlurChangeTitle('Hey, please come back');

  return <div>Hello GitHub!</div>;
};

Keywords

FAQs

Package last updated on 11 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc