Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-email-chips

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-email-chips

This is react component to create email chips list

  • 0.1.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-90.32%
Maintainers
1
Weekly downloads
 
Created
Source

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.

FAQs

Package last updated on 22 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc