Skip to content
This repository has been archived by the owner on Aug 12, 2021. It is now read-only.

curpeng/emails-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Emils Input Component

Preview

A simple js component, which provides you such features:

  • clipboard paste of multiple emails
  • insertion of an email via enter, comma keys or focusout event
  • removal of last email via backspace key
  • highlighting of invalid emails
  • simple API
  • no jQuery dependency
  • support of IE 11

Demo

How to use

  1. Include js and css file into your page
<script src="docs/components.abbc97bf.js"></script>
<link rel="stylesheet" href="docs/emails_input.6ae5d982.css" />
  1. build instance of the component
<script>
  var inputContainerNode = document.querySelector('#emails-input');
  var emailsInput = new EmailsInput(inputContainerNode, {...options});
</script>

If you want to subscribe on changes you can do:

  var emailsInput = new EmailsInput(inputContainerNode, {onChange: (emails) => { console.log(emails) } });

The constuctor accepts such options:

  • placeholder: String,
  • onChange: Function

API

To run locally

  • type in the terminal:
  yarn install
  yarn start

To release a new version of the demo page

  • run yarn build
  • commit changes
  • merge to master branch

About

JS component for emails list

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published