react-mailto-link
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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

Property Type Argument Default Description
email string <required> null email address of the intended recipient.
obfuscated boolean <optional> false show the email address in the status bar.
headers object <optional> null any 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.

Package Sidebar

Install

npm i react-mailto-link

Weekly Downloads

67

Version

1.0.4

License

MIT

Unpacked Size

8.53 kB

Total Files

6

Last publish

Collaborators

  • theo-mazars