diff --git a/README.md b/README.md index 71c7919..7708797 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ You can customize almost every aspect of this component using the below props, o | Name | Type | Default | Description | |:-: |--- |--- |--- | | email | string | none | The email to be copied. | +| theme | string | dark | Use "light" for light background. | | 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. | diff --git a/src/lib/index.tsx b/src/lib/index.tsx index 5313063..b392892 100644 --- a/src/lib/index.tsx +++ b/src/lib/index.tsx @@ -1,5 +1,7 @@ import React, { MouseEvent } from "react"; +type theme = "dark" | "light"; + const copyToClipboard = (str: string) => { const el = document.createElement("textarea"); // Create a