1.1.4 • Published 6 months ago

react-seo-manager v1.1.4

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

React-seo-manager

Overview

React-seo-manager is a lightweight React utility for managing SEO meta tags dynamically. It simplifies the process of updating page titles, descriptions, and other meta elements to improve search engine visibility and social media sharing.

Features

  • Dynamically set page titles and meta descriptions
  • Supports Open Graph and Twitter Card meta tags
  • Easy integration with React applications
  • Works with React 17 and 18

Installation

npm install react-seo-manager

or

yarn add react-seo-manager

Usage

Import the package and use it in your React components:

import React from "react";
import { useSEO } from "react-seo-manager";

const MyPage = () => {
  useSEO({
    title: "My Awesome Website - Home",
    description:
      "Welcome to my awesome website! Explore our features and services.",
    keywords: "website, awesome, features, services",
    image: "https://example.com/og-image.jpg",
    url: "https://example.com",
    type: "website",
  });

  return (
    <>
      <useSEO
        title="My Awesome Page"
        description="This is a great page for demonstrating React SEO capabilities."
        keywords="react, seo, meta tags"
      />
      <h1>Welcome to My Page</h1>
    </>
  );
};

export default MyPage;

Props

PropTypeDescription
titlestringPage title
descriptionstringMeta description for search engines
keywordsstringKeywords for SEO
ogTitlestringOpen Graph title for social media
ogImagestringURL of the Open Graph image
ogDescriptionstringOpen Graph description
twitterTitlestringTitle for Twitter Card
twitterImagestringImage URL for Twitter Card
twitterDescriptionstringDescription for Twitter Card

Development & Build

To build the project, use:

npm run build

For testing:

npm test

License

This project is licensed under the ISC License.

Author

Created by Abdulla al Mamun.