MiHCM
primitives/@mihcm/ui·v0.21.0·stable

Input

Single-line text entry. Default + destructive variants, three sizes, optional leading/trailing icons. WCAG 2.1 AA out of the box (aria-invalid, aria-required, focus ring).

In context

Realistic compositions — sign-in, filter bar, profile editor with live invalid state, and a tokenized payment form.

Welcome back

Sign in to your MiHCM workspace.

or

Employee directory

248 records · 12 departments

Live
23 matches

Profile details

Invalid state shown live as you type.

Must include an `@` symbol.

Billing details

Card details are tokenized and never stored.

Encrypted

Default

import { Input } from '@mihcm/ui/Input';
 
<Input placeholder="Email address" />

Email with leading icon

import { Input } from '@mihcm/ui/Input';
import { Mail } from '@mihcm/icons';
 
<Input
  type="email"
  placeholder="you@example.com"
  leadingIcon={<Mail className="size-4" />}
/>
import { Search } from '@mihcm/icons';
 
<Input
  type="search"
  placeholder="Search components…"
  leadingIcon={<Search className="size-4" />}
/>

Required, with validation error

const [email, setEmail] = useState('');
const error = email && !email.includes('@') ? 'Enter a valid email' : null;
 
<>
  <label htmlFor="email" className="text-sm font-medium">
    Email <span className="text-destructive">*</span>
  </label>
  <Input
    id="email"
    type="email"
    required
    value={email}
    onChange={(e) => setEmail(e.target.value)}
    invalid={!!error}
    aria-describedby={error ? 'email-error' : undefined}
  />
  {error && (
    <p id="email-error" className="mt-1 text-sm text-destructive">
      {error}
    </p>
  )}
</>

Disabled

<Input defaultValue="locked@example.com" disabled />

All sizes

<div className="flex flex-col gap-2 max-w-sm">
  <Input size="sm" placeholder="Small (36px)" />
  <Input size="md" placeholder="Medium (40px) — default" />
  <Input size="lg" placeholder="Large (48px) — mobile target" />
</div>

React Native

import { Input } from '@mihcm/ui/Input';
 
<Input
  size="lg"
  placeholder="Email address"
  accessibilityLabel="Email address"
  keyboardType="email-address"
  autoCapitalize="none"
  autoCorrect={false}
/>