bright_meta
v1.0.5
Published
`bright_meta` is a lightweight React component that simplifies the management of meta tags in your React applications. Inspired by the Next.js `<Head>` component, it allows you to add and remove meta tags dynamically, making it easier to manage SEO-relate
Downloads
12
Readme
bright_meta
bright_meta
is a lightweight React component that simplifies the management of meta tags in your React applications. Inspired by the Next.js <Head>
component, it allows you to add and remove meta tags dynamically, making it easier to manage SEO-related tasks.
Features
- Dynamically add and remove meta tags in the document head.
- No additional attributes are added to the meta tags.
- Supports
title
,meta
, andlink
tags.
Installation
You can install bright_meta
via npm:
npm install bright_meta
Or using yarn:
yarn add bright_meta
Usage
Here’s an example of how to use bright_meta
in a React project:
import bright_meta from "bright_meta";
const MyApp = () => {
return (
<div>
<bright_meta>
<title>My App Title</title>
<meta name="description" content="This is a description for my app" />
<meta name="keywords" content="react, seo, meta tags" />
<meta name="author" content="Mahadi Hasan" />
<meta property="og:image" content="https://example.com/image.png" />
</bright_meta>
<h1>Welcome to My App</h1>
</div>
);
};
export default MyApp;
Props
The bright_meta
component accepts any valid HTML head tag as children:
<title>
: Sets the document title.<meta>
: Adds meta tags for SEO purposes.<style>
: Adds style tags.<link>
: Adds link tags (e.g., for favicons or stylesheets).
How It Works
- Adding Tags: When the
bright_meta
component is rendered, it appends the specified tags to the<head>
of the document. - Removing Tags: When the component is unmounted, the tags are automatically removed, ensuring that only the necessary tags are present in the document.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Created by Mahadi Hasan.
Contributing
Contributions are welcome! Please open an issue or submit a pull request to contribute.
Enjoy using bright_meta
? Give it a ⭐ on GitHub!
Summary of the README.md
Sections:
- Introduction: A brief description of the package and its purpose.
- Installation: Instructions on how to install the package.
- Usage: Example code showing how to use the
bright_meta
component. - Props: Explanation of the props that can be passed to
bright_meta
. - How It Works: A description of how the component adds and removes tags.
- License: License information for the package.
- Author: Information about the creator of the package.
- Contributing: Information about contributing to the project.