Open this example in the interactive library
Live preview
Source code
// components/ContactEmailShortcut.tsx
export default function ContactEmailShortcut({
name = "Mira Bell",
role = "Editor",
}: { name?: string; role?: string } = {}) {
const subject = encodeURIComponent("For " + name + " · " + role);
return <a href={"mailto:?subject=" + subject}>Draft a message for {name}</a>;
}
