GithubHelp home page GithubHelp logo

gribesh / react-copy-mailto Goto Github PK

View Code? Open in Web Editor NEW

This project forked from devfolioco/react-copy-mailto

0.0 0.0 0.0 281 KB

Node module to add a copy popover on mailto links.

License: MIT License

HTML 6.41% TypeScript 70.53% JavaScript 23.06%

react-copy-mailto's Introduction

react-copy-mailto

All Contributors

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. Big shout out to Kuldar whose tweet thread inspired us to build this.

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 protected]" />
    </div>
);

Props

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

Name Type Default Description
email string none The email to be copied.
children ReactNode null Use this if you want to use some custom component inside the anchor tag.
defaultTooltip string "Copy email address" Text shown in the tooltip when the user hovers over the link.
copiedTooltip string "Copied to clipboard!" Text shown in the tooltip when the user clicks on the link and the text is copied to clipboard.
containerStyles style object none The styles to be applied to the container.
tooltipStyles style object none The styles to be applied to the tooltip.
anchorStyles style object none The 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

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


Prateek Surana

๐Ÿ’ป ๐ŸŽจ ๐Ÿ–‹ ๐Ÿ“–

Ankit Raj

๐Ÿ”ง

This project follows the all-contributors specification. Contributions of any kind welcome!

react-copy-mailto's People

Contributors

prateek3255 avatar akashnimare avatar allcontributors[bot] avatar apollonian avatar surajv311 avatar ankiiitraj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.