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.
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.
Related components
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
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.
Related components
All text and visual effects- Interactive Sprite
Turn a directional sprite sheet into a character that follows the pointer and returns to rest.
- Kinetic Heading
A heading that rises word by word or letter by letter from a masked baseline on mount or scroll, with springs, grapheme-safe splitting, and one real heading for screen readers.
- Ripple Reveal
Hide or show a sensitive value with a ripple that starts exactly where you tap. A damped sine swell travels out across the surface and flips the content between its shown and hidden faces as the front passes, with a soft tap and a light haptic.
- Scratch Card
A foil scratch-off card. Rub the foil away with a finger or cursor to reveal what is underneath, with a scratch texture that follows your speed, foil flakes, and a soft chime when the rest lifts off.