ezekielaquino / react-favicon

Set or animate your React app's favicon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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'));

About

Set or animate your React app's favicon


Languages

Language:HTML 100.0%