react-mail-chips
v0.3.2
Published
🍟 A simple react component for managing and displaying multiple email addresses as chips.
Downloads
56
Maintainers
Readme
React Mail Chips
A React component library for managing email input as chips.
- Easy to configure
- No dependency
- Simple to use
Table of Contents
Installation
Install the library using npm:
npm install react-mail-chips
Or using yarn:
yarn add react-mail-chips
Usage
Here's a basic example of how to use the ReactMailChips component:
import React, { useState } from "react";
import { ReactMailChips } from "react-mail-chips";
const App = () => {
const [emails, setEmails] = useState<string[]>([]);
return (
<div>
<ReactMailChips emails={emails} setEmails={setEmails} />
</div>
);
};
export default App;
Props
| Property | Type | Description | Default |
| ----------------------- | --------------------------- | ----------------------------------------------- | ------------------- |
| emails | string[]
| An array of email strings. | |
| setEmails | (emails:string[]) => void
| A function to update the emails array. | |
| className | string?
| Additional class names for the container. | ""
|
| chipClassName | string?
| Additional class names for each chip. | ""
|
| inputContainerClassName | string?
| Additional class names for the input container. | ""
|
| placeholder | string?
| Placeholder text for the input field. | ""
|
| delimiters | string[]?
| An array of delimiters to separate emails. | ["Enter",",",";"]
|
License
This project is licensed under the MIT License