0.1.20 • Published 5 years ago

react-email-chips v0.1.20

Weekly downloads
87
License
-
Repository
github
Last release
5 years ago

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)
import React from 'react';
import Chips from 'react-email-chips';

function DemoComponent() {
	const pattern = new RegExp(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/);
	return (
		<div className='Demo'>
			<Chips
				chips={[{ email: 'react@gmail.com', valid: true, key: '1' }, { email: 'javascript@gmail.com', valid: true, key: '2' }, { email: 'scss@gmail.com', valid: true, key: '3' }]}
				placeholder='Add a tag...'
				save={data => console.log('new data', data)}
				pattern={pattern}
				required={true}
				title='Email Chips:'
				limit='5'
				limitNotification={data => console.log('limit notification', data)}
			></Chips>
		</div>
	);
}

License

MIT Licensed.

0.1.20

5 years ago

0.1.19

5 years ago

0.1.18

5 years ago

0.1.17

5 years ago

0.1.16

5 years ago

0.1.14

5 years ago

0.1.13

5 years ago

0.1.12

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago