0.3.7 • Published 6 years ago

react-multi-email-custom v0.3.7

Weekly downloads
28
License
MIT
Repository
github
Last release
6 years ago

react-multi-email-custom

This pretends to be a custom version of http://react-multi-email.axisj.com/.

please vitit http://react-multi-email.axisj.com/ for the original version

Installation

npm install react-multi-email-custom -S

Usage

import * as React from 'react';
import { ReactMultiEmailCustom } from 'react-multi-email-custom';
import 'react-multi-email-custom/style.css';

class Basic extends React.Component {
  state = {
    emails: [],
  };

  render() {
    const { emails } = this.state;
    const myStyle = {};
    
    return (
      <>
        <Segment>
          <Form>
            <Form.Field>
              <label>Email</label>

              <ReactMultiEmailCustom
                style={myStyle}
                emails={emails}
                onChange={_emails => {
                  this.setState({ emails: _emails });
                }}
                getLabel={(
                  email,
                  index,
                  removeEmail,
                ) => {
                  return (
                    <Label key={index}>
                      {email}
                      <Icon name="delete" onClick={() => removeEmail(index)} />
                    </Label>
                  );
                }}
              />
            </Form.Field>
            <Form.Field>
              <label>react-multi-email-custom value</label>
              {emails.join(', ') || 'empty'}
            </Form.Field>
          </Form>
        </Segment>
      </>
    );
  }
}

License

MIT

0.3.7

6 years ago

0.1.6

6 years ago

0.3.6

6 years ago

0.1.5

6 years ago

0.3.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.3.4

6 years ago

0.1.2

6 years ago