1.0.2 • Published 5 months ago

react-tagaroo v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

React-Tagaroo

React-Tagaroo is a reusable, customizable, and lightweight React component that allows developers to manage tags or keywords dynamically. This component provides functionality to add, remove, and clear tags, making it suitable for forms, filters, or any application where dynamic tag management is required.

🚀 Features

  • Add tags dynamically with keyboard events (Enter or Comma).
  • Remove individual tags with a button.
  • Clear all tags at once with a single click.
  • Fully customizable labels, placeholders, and styles.
  • Lightweight and easy to integrate into your React projects.

📦 Installation

Install the package using npm or yarn:

npm install react-tagaroo
# or
yarn add react-tagaroo

🚀 Usage

import React, { useState } from "react";
import TagsField from "react-tagaroo";

const App = () => {
  const [tags, setTags] = useState([]);

  return (
    <div style={{ padding: "2rem" }}>
      <h1>React Tagaroo Example</h1>
      <TagsField
        tags={tags}
        setTags={setTags}
        label="Add Tags"
        placeholder="Type and press Enter or comma to add tags"
      />
      <div>
        <h3>Current Tags:</h3>
        <ul>
          {tags.map((tag, index) => (
            <li key={index}>{tag}</li>
          ))}
        </ul>
      </div>
    </div>
  );
};

export default App;

📜 Props

PropTypeRequiredDefaultDescription
tagsArray[]Array of current tags.
setTagsFunction-Callback to update the tags array.
labelString"Tags"Label text for the input field.
placeholderString"Type and press Enter or comma"Placeholder text for the input field.
errorsString""Error message to display below the input (if applicable).

📚 License

This project is licensed under the MIT License.