New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-copy-mailto

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-copy-mailto

A fully customizable React component for copying email from mailto links

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

react-copy-mailto

npm version npm bundle size

A fully customizable React component for copying email from mailto links.

Motivation

The one thing we all can agree on that we hate it when the default mail app pops up after clicking on the mailto links. Most of the time we just want to copy the email address and that's where this module comes into play.

Demo

here

Installation and Usage

The easiest way to use this library is to install it via yarn or npm

yarn add react-copy-mailto

or

npm install react-copy-mailto

Then just use it in your app:

import React from "react";
import CopyMailTo from "react-copy-mailto";

const YourComponent = () => (
    <div>
        <CopyMailTo email="email@domain.com" />
    </div>
);

Props

You can customize almost every aspect of this component using the below props, out of which email is the only required prop.

NameTypeDefaultDescription
emailstringnoneThe email to be copied
childrenReactNodenullUse this if you want to use some custom component inside the anchor tag.
defaultTooltipstring"Copy email address"Text shown in the tooltip when the user hovers over the link.
copiedTooltipstring"Copied to clipboard!"Text shown in the tooltip when the user clicks on the link and the text is copied to clipboard.
containerStylesstyle objectnoneThe styles to be applied to the container
tooltipStylesstyle objectnoneThe styles to be applied to the tooltip
anchorStylesstyle objectnoneThe styles to be applied to the anchor

Development

  • Install the dependencies
yarn
  • Run the example on the development server
yarn demo:dev

Contributing

GitHub issues GitHub pull requests

Feel free to open issues and pull requests!

License

NPM

Keywords

FAQs

Package last updated on 03 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc