SSE Hooks

useFavicon

Custom hook that sets the document favicon.

Installation

npx sse-tool add use-favicon

Usage

import { useFavicon } from "./{hooks file}";

// Basic usage
useFavicon("/assets/favicon-dark.ico");
// With options
useFavicon("/assets/notification-badge.ico", {
  preserveFaviconOnUnmount: false, // Revert when component unmounts
  type: "image/png",
});

API

Parameters

NameTypeDescription
hrefstringThe URL of the favicon to set.
optionsUseFaviconOptionsConfiguration options.

Changelog

81fa5 — feat: add useAutoSave and useCallbackRef hooks with comprehensive documentation

Built with Love • © 2026