Skip to content

TkxInput

import { TkxInput } from 'tekivex-ui';
<TkxInput label="Email" type="email" />
With label
<TkxInput label="Full name" placeholder="Jane Doe" />
With hint
3–20 characters, lowercase only
Error state
Enter a valid email address
Unicode-safe (zero-width characters stripped)
Zero-width and bidi-override characters are stripped automatically.
Stored value length: 0

By default, every TkxInput strips zero-width and bidi-override Unicode characters on input — defending against the Trojan Source attack class (CVE-2021-42574). This is on by default. Disable only for translation UIs that legitimately need them:

<TkxInput label="Translation" unicodeSafe={false} />
PropTypeRequiredDescription
labelstringyesVisible label — required for WCAG compliance.
idstringAuto-generated if omitted.
errorstringError message. Renders below the field with role="alert".
hintstringHelper text. Linked via aria-describedby.
leftAddon / rightAddonReactNodeSlot content rendered inside the input frame.
isInvalidbooleanAdds the danger border + aria-invalid.
isRequiredbooleanAdds the required asterisk + aria-required.
unicodeSafebooleanStrip zero-width / bidi Unicode. Default true.

All other props are forwarded to the underlying <input> element.

  • Visible <label> linked via htmlFor. Never use placeholder-as-label.
  • aria-describedby automatically points at hint + error when present.
  • aria-invalid set when isInvalid is true.
  • :focus-visible outline at 2px (configurable via theme).
  • 44×44 minimum touch area on the entire field.
  • Error messages use role="alert" so screen readers announce immediately.

src/components/TkxInput.tsx