Security News
vlt Debuts New JavaScript Package Manager and Serverless Registry at NodeConf EU
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
@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 336,800 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
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
Security News
Research
The Socket Research Team uncovered a malicious Python package typosquatting the popular 'fabric' SSH library, silently exfiltrating AWS credentials from unsuspecting developers.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.