/
1.1k
Sponsor

Email Input

Email input with validation and domain suggestions

Terminal

Installation

$ pnpm dlx shadcn@latest add @termcn/ink/email-input

Usage

import { EmailInput } from "@/components/ui/email-input";
<EmailInput
  label="Email"
  placeholder="you@example.com"
  onSubmit={(value) => console.log("Submitted:", value)}
/>

API Reference

EmailInput

PropTypeDefault
valuestring-
onChange(value: string) => void-
onSubmit(value: string) => void-
labelstring-
placeholderstring"you@example.com"
autoFocusbooleanfalse
idstring-
widthnumber40
suggestionsstring[]["gmail.com", "yahoo.com", "hotmail.com", "outlook.com"]

Notes

Accessibility

termcn exposes the following behavior through Ink's terminal accessibility APIs. This is not a browser ARIA or general WCAG-conformance claim.

  • Keyboard: Left / Right move by grapheme, Home / End move to the boundaries, and Backspace / Delete remove one complete grapheme. Enter submits or confirms (Ctrl+Enter in TextArea); Tab / Shift+Tab leave through Ink focus traversal.
  • Focus and composition: Input is active only while the component's focus target is focused, enabled, active, and inside the topmost focus scope.
  • Screen reader: Ink labels and semantic state expose the component without relying on visual styling alone.