Components

React component for shadcn/ui

Email Dock

An accessible Email Dock component for React and shadcn/ui that highlights and links the username, domain, or complete email address.

Loading…

Email Dock is a React component for shadcn/ui that turns a plain contact address into linked username, website, and email actions. Use it on a portfolio, profile, or contact page, then customize the links and accessible labels.

Features

  • Highlights the username, domain, or full address independently.
  • Activates highlights on pointer hover, keyboard focus, or button click.
  • Supports links and custom accessible labels for dock actions.

Installation

pnpm dlx shadcn@latest add @tentui/email-dock

Usage

import { EmailDock } from "@/components/email-dock";
const email = "hello@example.com";
 
<EmailDock
  email={email}
  highlights={[
    { segment: "local" },
    { segment: "domain", href: "https://example.com", external: true },
    { segment: "full", href: `mailto:${email}` },
  ]}
/>

Omit highlights to render the default username, domain, and full-address actions without links.

Accessibility

The address is exposed to assistive technology as one complete email address, while its decorative segments are hidden. Each dock action is a native button or link with an accessible label and a visible focus ring. Keyboard focus activates the corresponding highlight.

Provide label when the built-in username, domain, or email label does not describe a custom action.

Use Copy Button when visitors also need to copy the address to their clipboard, or Animated Arrow when a single contact link needs directional hover and keyboard-focus feedback.

API reference

PropType

FAQ

How do I install the Email Dock with shadcn?

Run npx shadcn@latest add @tentui/email-dock after adding the @tentui registry to components.json (installation guide), or run npx shadcn@latest add https://tentui.com/r/email-dock.json without it. The CLI copies email-dock.tsx into your project and installs lucide-react.

How do I make the dock icons open a mail app or website?

Give a highlight an href, such as mailto: for the full address or a URL for the domain, and set external to open it in a new tab. Highlights without an href render as buttons that only highlight their part of the address.

Can the Email Dock copy the address to the clipboard?

Not on its own. It highlights and links parts of the address; pair it with the Copy Button when visitors need to copy it.

Does it hide my email address from spam bots?

No. The full address is in the page as plain, screen-reader-visible text, so use another approach if you need to obscure it from scrapers.

Is the Email Dock keyboard accessible?

Yes. Each dock action is a native button or link with an accessible label, and focusing one activates the same highlight as hovering it. Screen readers read the address once as a whole; set label on a highlight when the default "Highlight username", "Highlight domain", or "Highlight full email" doesn't describe its action.

Is the Email Dock free to use?

Yes. The Email Dock is free and source-available: the shadcn CLI copies its source into your project, and you can use it in unlimited personal and client projects under the TentUI License. The license doesn't allow redistributing or reselling the component itself.

All text and visual effects