Smart Blog Generator utilizes OpenAI's ChatGPT 3.5 to generate custom blogs on any topic based on user-provided titles, optional descriptions, and selected blog types.
Smart Blog Generator is a React component library that leverages OpenAI's ChatGPT 3.5 to create unique and relevant blog content based on user input. It allows users to enter a blog title, provide an optional description, and select the type of blog they want to generate. With a sleek and responsive interface, Smart Blog Generator is designed to be easily embedded into other React applications for dynamic content creation.
- 🎯 Generate blog posts based on user-provided title and optional descriptions
- 🧠 Uses OpenAI's GPT-3.5-turbo model to generate human-like content
- 🔐 API key validation before use
- 🧩 Copy-to-clipboard functionality for generated content
- 💅 TailwindCSS-powered UI with support for custom styling
- 💻 Markdown rendering with code block support
This guide will help you install and start using the Smart Blog Generator component in your React project.
Before using this package, make sure you have:
- Node.js >= 14.x
- A valid OpenAI API Key
- A React project (with Tailwind CSS if you want consistent styling)
- Internet connection (required for OpenAI API calls)
Install the package using your preferred package manager:
npm install smart-blog-generator
# or
yarn add smart-blog-generatorEnsure you have Tailwind CSS configured. If not, follow the Tailwind CSS installation guide.
Then, include the CSS file in your project’s entry file :
import "smart-blog-generator/dist/style.css";Import and use the component in your React project:
import React from "react";
import { SmartBlogGenerator } from "smart-blog-generator";
const App = () => {
return (
<div className="p-8">
<SmartBlogGenerator
apiKey="YOUR_OPENAI_API_KEY"
cardClassName="shadow-lg"
/>
</div>
);
};
export default App;| Prop | Type | Required | Description |
|---|---|---|---|
apiKey |
string |
Yes | Your OpenAI API key |
cardClassName |
string |
No | Custom Tailwind classes for outer card container |
We welcome contributions!
To contribute:
- Fork this repository
- Create your feature branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -am 'Add new feature' - Push to the branch:
git push origin feature/your-feature - Open a pull request
Please read the CONTRIBUTING.md for more details.
This project is licensed under the MIT License. See the LICENSE.md file for details.
- OpenAI for the GPT-3.5-turbo API
- Tailwind CSS for utility-first styling
- React Markdown for rendering markdown in React
- Radix UI Icons for beautiful icons
🚀 If you find this project useful, feel free to star the repository or share it!