react-mailto-link
v1.0.6
Published
A react component to create and display a mailto link in a more secure way.
Downloads
117
Maintainers
Readme
react-mailto-link
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="[email protected]" obfuscated={true} />;
};
// OR
const Component = () => {
return (
<Mailto email="[email protected]" 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.