1.0.4 • Published 15 days ago

react-mailto-link v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
15 days ago

react-mailto-link

CI NPM

A react component to create and display a mailto link in a more secure way.

Inspired by https://github.com/jasonbellamy/react-mailto

Getting Started

  • Install from NPM
    • npm install --save react-mailto-link
    • yarn add react-mailto-link

Usage

import React from "react";
import Mailto from "react-mailto-link";

const Component = () => {
  return <Mailto email="john.doe@example.com" obfuscated={true} />;
};

// OR

const Component = () => {
  return (
    <Mailto email="john.doe@example.com" obfuscated={true}>
      <div>Custom Children</div>
    </Mailto>
  );
};

export default Component;

Options

PropertyTypeArgumentDefaultDescription
emailstring<required>nullemail address of the intended recipient.
obfuscatedboolean<optional>falseshow the email address in the status bar.
headersobject<optional>nullany standard mail header fields. The most commonly-used of these are "subject", "cc", and "body" (which is not a true header field, but allows you to specify a short content message for the new email).

Developing

react-mailto-link is built using ES6. Run the following task to compile the src/ into lib/.

$ npm run build
# OR
$ yarn build

License

©2015 Jason Bellamy

©2021 Theo Mazars

Licensed under the MIT license.