A React component library for managing email input as chips.
- Easy to configure
- No dependency
- Simple to use
Install the library using npm:
npm install react-mail-chips
Or using yarn:
yarn add react-mail-chips
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;
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",",",";"] |
This project is licensed under the MIT License