https://github.com/freightos/react-email-chips
https://github.com/freightos/react-email-chips
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/freightos/react-email-chips
- Owner: Freightos
- Created: 2019-10-28T09:28:18.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T02:37:04.000Z (over 3 years ago)
- Last Synced: 2026-04-21T06:46:40.206Z (about 1 month ago)
- Language: JavaScript
- Size: 1.67 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Email chips component
This is react component to create email chips list
I know there is more advanced component's of this type
but this gives exactly what I need .
I forked my code from
https://codepen.io/broneks/pen/objeqq
The component can receive the following props
- placeholder - to be placed in the input
- pattern - to validate the chips - can be empty then all chips are valid
- required - force the list to have at least one value
- title - title of the component
- save - a callback to be called on each change (add , delete)
```js
import React from 'react';
import Chips from 'react-email-chips';
function DemoComponent() {
const pattern = new RegExp(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/);
return (
console.log('new data', data)}
pattern={pattern}
required={true}
title='Email Chips:'
limit='5'
limitMessage='You’ve hit the maximum number of emails'
>
);
}
```
### License
MIT Licensed.