Skip to content

TkxTextarea

The multi-line counterpart to TkxInput. Same accessible label / hint / error / isRequired surface, plus the things a textarea actually needs: auto-grow, a character counter, and Trojan-Source Unicode stripping on input.

import { TkxTextarea } from 'tekivex-ui';
<TkxTextarea label="Bio" hint="A short description" placeholder="Tell us about yourself" />

Set autoResize to grow the field with its content, bounded by minRows and maxRows (it scrolls past maxRows). Manual drag-resize is disabled while auto-growing.

<TkxTextarea label="Notes" autoResize minRows={2} maxRows={10} />

showCount renders a live n / max counter; it turns danger-coloured at the limit. Works in both controlled and uncontrolled mode.

<TkxTextarea label="Tweet" showCount maxLength={280} />
<TkxTextarea label="Message" isRequired error="Message is required" />

error sets aria-invalid, renders a role="alert" message, and links it via aria-describedby. isRequired adds aria-required and a visual asterisk (the asterisk is aria-hidden).

PropTypeDefaultDescription
labelstringRequired. Accessible label.
hintstringHelper text below the field.
errorstringError message; sets aria-invalid + role="alert".
isInvalidbooleanfalseForce the invalid style without an error string.
isRequiredbooleanfalseAdds aria-required + asterisk.
autoResizebooleanfalseGrow with content between minRows/maxRows.
minRowsnumber3Minimum visible rows.
maxRowsnumber8Max rows before scrolling (auto-resize only).
showCountbooleanfalseShow a live character counter.
maxLengthnumberHard character cap; powers the counter colour.
unicodeSafebooleantrueStrip zero-width / bidi-override Unicode on input.
value / defaultValuestringControlled / uncontrolled value.
...restTextareaHTMLAttributesonChange, placeholder, name, disabled, etc.

The component forwards its ref to the underlying <textarea>.