UNPKG

metafy-seo

Version:

Lightweight, dependency-free React components and utilities for managing SEO metadata (meta tags, Open Graph, Twitter Cards) with optional SSR markup generation.

27 lines (26 loc) 764 B
import React from 'react'; import { SeoConfig } from './types'; /** * React component that injects SEO tags into the document <head>. * * It handles: * - title, meta[name*], link[rel=canonical] * - Open Graph and Twitter Card tags * - custom extraMeta and extraLinks entries * * @remarks * Uses a cleanup effect to remove tags when this component unmounts. * * @example * <SeoTags * title="My Page" * description="Page description" * canonical="/my-page" * openGraph={{ url: '/my-page', title: 'My Page' }} * twitter={{ card: 'summary', site: '@mysite' }} * /> * * @param config - SEO configuration object (see SeoConfig). * @returns `null` (manipulates <head> as side effect). */ export declare const SeoTags: React.FC<SeoConfig>;