TkxInput
import { TkxInput } from 'tekivex-ui';
<TkxInput label="Email" type="email" />With label
Variants
Section titled “Variants”<TkxInput label="Full name" placeholder="Jane Doe" /><TkxInput label="Username" hint="3–20 characters, lowercase only" pattern="[a-z0-9]{3,20}"/><TkxInput label="Email" defaultValue="not-an-email" isInvalid error="Enter a valid email address"/><TkxInput label="Website" leftAddon={<span>https://</span>} rightAddon={<span>.com</span>}/>With hint
3–20 characters, lowercase only
Error state
Enter a valid email address
Built-in Unicode safety
Section titled “Built-in Unicode safety”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} />| Prop | Type | Required | Description |
|---|---|---|---|
label | string | yes | Visible label — required for WCAG compliance. |
id | string | Auto-generated if omitted. | |
error | string | Error message. Renders below the field with role="alert". | |
hint | string | Helper text. Linked via aria-describedby. | |
leftAddon / rightAddon | ReactNode | Slot content rendered inside the input frame. | |
isInvalid | boolean | Adds the danger border + aria-invalid. | |
isRequired | boolean | Adds the required asterisk + aria-required. | |
unicodeSafe | boolean | Strip zero-width / bidi Unicode. Default true. |
All other props are forwarded to the underlying <input> element.
Accessibility
Section titled “Accessibility”- Visible
<label>linked viahtmlFor. Never use placeholder-as-label. aria-describedbyautomatically points at hint + error when present.aria-invalidset whenisInvalidis true.:focus-visibleoutline at 2px (configurable via theme).- 44×44 minimum touch area on the entire field.
- Error messages use
role="alert"so screen readers announce immediately.