MailToLink
The MailToLink component renders a link that opens the user’s default email client with a pre-filled email.
<MailToLink email="Emilio_Konopelski27@hotmail.com" subject="Curiositas pecco harum stillicidium illo vergo." body="Pauper deleniti bibo solutio solus depraedor usque antepono. Turba conspergo tenetur subvenio tollo tenax terreo. Temperantia ullam suppellex decerno." />
Features
Scraper Protection
In order to prevent email harvesting bots from scraping the email address, the component makes it slightly harder to find in two ways.
- First, the email address that is rendered as text is split at the
@symbol and rendered separately, to make pattern matching more difficult. You can see this in the Anatomy. - Second, the
hrefattribute with themailto:link is not applied to the element initially. Instead, it is set when the user interacts with the link by clicking, focusing, hovering, or pressing down on it.
Anatomy
1.LinkThe root link component.
2.UserThe user part of the email address.
3.AtThe "@" symbol.
4.DomainThe domain part of the email address.
Reference
MailToLinkProps
The MailToLink component accepts all props from the Link component, except for href.
| Name | Type | Required | Description |
|---|---|---|---|
email | string | true | The email address to send to. |
cc | string[] | false | An array of email addresses to CC. |
bcc | string[] | false | An array of email addresses to BCC. |
subject | string | false | The subject of the email. |
body | string | false | The body of the email. |
Tokens
The MailToLink component uses the tokens from the link component.
| Key | Default Value |
|---|---|
anchor.base.borderRadius | var(--gpqiqdw) |
anchor.variants.inline.true.color | var(--gpqiq2x) |
anchor.variants.inline.true.opacity | none |
anchor.variants.inline.true.font | var(--_1i4ikbk25) |
anchor.variants.inline.true.:hover.color | color-mix(in srgb, var(--gpqiq2x) 95%, var(--_1i4ikbkv) 5%) |
anchor.variants.inline.true.:hover.opacity | none |
anchor.variants.inline.true.:hover.font | var(--_1i4ikbk25) |
anchor.variants.inline.true.:focus-visible.backgroundColor | #ffffff |
anchor.variants.inline.true.:focus-visible.color | color-mix(in srgb, var(--gpqiq2x) 95%, var(--_1i4ikbkv) 5%) |
anchor.variants.inline.true.:focus-visible.opacity | none |
anchor.variants.inline.true.:focus-visible.font | var(--_1i4ikbk25) |
anchor.variants.inline.true.:focus-visible.outlineWidth | var(--_1i4ikbk2e) |
anchor.variants.inline.true.:focus-visible.outlineStyle | var(--_1i4ikbk2f) |
anchor.variants.inline.true.:focus-visible.outlineColor | var(--_1i4ikbk2g) |
anchor.variants.inline.true.:focus-visible.outlineOffset | var(--_1i4ikbk2h) |
anchor.variants.inline.true.:active.color | color-mix(in srgb, var(--gpqiq2x) 95%, var(--_1i4ikbkv) 5%) |
anchor.variants.inline.true.:active.opacity | none |
anchor.variants.inline.true.:active.font | var(--_1i4ikbk25) |
anchor.variants.inline.true.:disabled.color | var(--gpqiq2x) |
anchor.variants.inline.true.:disabled.opacity | var(--_1i4ikbk2i) |
anchor.variants.inline.true.:disabled.font | var(--_1i4ikbk25) |
anchor.variants.inline.false.font | var(--_1i4ikbk25) |
anchor.variants.inline.false.color | var(--_1i4ikbkv) |
anchor.variants.inline.false.opacity | none |
anchor.variants.inline.false.:hover.font | var(--_1i4ikbk25) |
anchor.variants.inline.false.:hover.color | var(--gpqiq2x) |
anchor.variants.inline.false.:hover.opacity | none |
anchor.variants.inline.false.:focus-visible.font | var(--_1i4ikbk25) |
anchor.variants.inline.false.:focus-visible.backgroundColor | var(--gpqiq35) |
anchor.variants.inline.false.:focus-visible.color | var(--gpqiq2x) |
anchor.variants.inline.false.:focus-visible.opacity | none |
anchor.variants.inline.false.:focus-visible.outlineWidth | var(--_1i4ikbk2e) |
anchor.variants.inline.false.:focus-visible.outlineStyle | var(--_1i4ikbk2f) |
anchor.variants.inline.false.:focus-visible.outlineColor | var(--_1i4ikbk2g) |
anchor.variants.inline.false.:focus-visible.outlineOffset | var(--_1i4ikbk2h) |
anchor.variants.inline.false.:active.font | var(--_1i4ikbk25) |
anchor.variants.inline.false.:active.color | var(--gpqiq2x) |
anchor.variants.inline.false.:active.opacity | none |
anchor.variants.inline.false.:disabled.font | var(--_1i4ikbk25) |
anchor.variants.inline.false.:disabled.color | var(--_1i4ikbkv) |
anchor.variants.inline.false.:disabled.opacity | var(--_1i4ikbk2i) |
row.base.gap | var(--gpqiqd3) |
icon.variants.inline.true.color | var(--gpqiq2x) |
icon.variants.inline.true.:hover.color | color-mix(in srgb, var(--gpqiq2x) 95%, var(--_1i4ikbkv) 5%) |
icon.variants.inline.true.:focus-visible.color | color-mix(in srgb, var(--gpqiq2x) 95%, var(--_1i4ikbkv) 5%) |
icon.variants.inline.true.:active.color | color-mix(in srgb, var(--gpqiq2x) 95%, var(--_1i4ikbkv) 5%) |
icon.variants.inline.true.:disabled.color | var(--gpqiq2x) |
icon.variants.inline.false.color | var(--_1i4ikbkv) |
icon.variants.inline.false.:hover.color | var(--gpqiq2x) |
icon.variants.inline.false.:focus-visible.color | var(--gpqiq2x) |
icon.variants.inline.false.:active.color | var(--gpqiq2x) |
icon.variants.inline.false.:disabled.color | var(--_1i4ikbkv) |
Last updated on