Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

react-favicon

0.0.18 • Public • Published

react-favicon

Control the favicon from a React app

Demo

http://oflisback.github.io/react-favicon

Installation

npm install react-favicon --save

Features

  • Update the favicon with a url or base64 encoded image
  • Animate through a list of urls
  • Toggle animation
  • Alert bubbles
  • Allow some favicons to be kept on the page, which may be desirable for desktop Safari

Usage

<Favicon url={[url1, url2, url3]}/>

See index.html for the demo page source code. If you have support for import (via e.g. babel), basic usage is as simple as importing the react-favicon package and including a Favicon component in the react component tree.

import React from 'react';
import ReactDOM from 'react-dom';
import Favicon from 'react-favicon';
 
ReactDOM.render(
    <div>
      <Favicon url="http://oflisback.github.io/react-favicon/public/img/github.ico" />
      <h1>Hello, Favicon!</h1>
    </div>
  , document.getElementById('root'));

Keywords

Install

npm i react-favicon

DownloadsWeekly Downloads

17,477

Version

0.0.18

License

MIT

Unpacked Size

9.24 kB

Total Files

4

Last publish

Collaborators

  • avatar