
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@react-email/link
Advanced tools
A hyperlink to web pages, email addresses, or anything else a URL can address
@react-email/link is a React component library designed to simplify the creation of email links in React applications. It provides a straightforward way to generate email-friendly links with customizable properties, ensuring compatibility and ease of use.
Basic Link Creation
This feature allows you to create a basic hyperlink that can be used in an email. The `href` attribute specifies the URL the link points to, and the text between the tags is the clickable text.
<Link href="https://example.com">Click here</Link>
Customizable Link Text
This feature allows you to customize the appearance of the link text using inline styles. In this example, the link text is styled to be blue and without an underline.
<Link href="https://example.com" style={{ color: 'blue', textDecoration: 'none' }}>Visit our site</Link>
Tracking Links
This feature allows you to add custom data attributes to the link for tracking purposes. The `data-tracking-id` attribute can be used to track user interactions with the link.
<Link href="https://example.com" data-tracking-id="12345">Trackable Link</Link>
react-router-dom is a popular package for handling routing in React applications. It provides a `Link` component that is used to create navigational links within a React app. Unlike @react-email/link, it is not specifically designed for email links but for in-app navigation.
react-mailchimp-subscribe is a package for integrating Mailchimp subscription forms in React applications. It includes components for creating subscription links and forms. While it focuses on email subscriptions, it does not provide the same level of customization for email links as @react-email/link.
Install component from your command line.
yarn add @react-email/link -E
npm install @react-email/link -E
Add the component to your email template. Include styles where needed.
import { Link } from "@react-email/link";
const Email = () => {
return <Link href="https://example.com">Example</Link>;
};
Name | Type | Default | Description |
---|---|---|---|
href | string | Link to be triggered when the button is clicked | |
target | string | _blank | Specify the target attribute for the button link |
This component was tested using the most popular email clients.
Gmail ✔ | Apple Mail ✔ | Outlook ✔ | Yahoo! Mail ✔ | HEY ✔ | Superhuman ✔ |
MIT License
FAQs
A hyperlink to web pages, email addresses, or anything else a URL can address
The npm package @react-email/link receives a total of 412,897 weekly downloads. As such, @react-email/link popularity was classified as popular.
We found that @react-email/link demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.