`react-multi-email` is a lightweight and dependency-free React component designed for creating an input field that can manage and format multiple email addresses as a user types. Currently stable at version `1.0.25`, the library maintains a moderate release cadence, addressing bugs and adding new features such as improved handling of duplicate emails (case-insensitive) and an `inputValue` prop. Its core differentiators include a minimalist codebase, small bundle size, and straightforward customization options, allowing developers to easily integrate a robust multi-email input without significant overhead. It supports both synchronous and asynchronous email validation and offers custom label rendering for each email, making it a flexible choice for forms requiring multiple email entries.
npm install react-multi-emailVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates the basic usage of the `ReactMultiEmail` component, showing how to manage emails using React state, handle focus/blur events, and utilize custom label rendering with the included `isEmail` validator.
Ensure `import 'react-multi-email/dist/style.css';` is included in your main application entry point or the component file where `ReactMultiEmail` is used.
Upgrade to `react-multi-email@1.0.25` or higher, which includes a fix for this spinner behavior during asynchronous email validation failures.
When upgrading and utilizing the `inputValue` prop, thoroughly test your component's input behavior to ensure it aligns with expectations and doesn't conflict with existing state management or event handlers.
Verify that `react-multi-email` is correctly installed. Ensure the path `react-multi-email/dist/style.css` is accessible and that your build setup correctly handles CSS imports.
Use a named import: `import { ReactMultiEmail } from 'react-multi-email';` for ESM environments. If using CommonJS, ensure `const { ReactMultiEmail } = require('react-multi-email');` is used, though the library primarily targets modern React setups with ESM.Confirm that `import 'react-multi-email/dist/style.css';` is present and correctly imported into your application. Check your browser's developer tools to see if the stylesheet is loaded and if its styles are being applied or overridden.