A react component to create and display a mailto link in a more secure way.
Inspired by https://github.com/jasonbellamy/react-mailto
- Install from NPM
npm install --save react-mailto-link
yarn add react-mailto-link
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;
Property | Type | Argument | Default | Description |
---|---|---|---|---|
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). |
react-mailto-link is built using ES6. Run the following task to compile the src/
into lib/
.
$ npm run build
# OR
$ yarn build
©2015 Jason Bellamy
©2021 Theo Mazars
Licensed under the MIT license.