Textarea Component

The Textarea component is a multi-line text input field that can be customized for various use cases.

Props

PropTypeDefaultDescription
labelstringundefinedLabel text for the textarea
size"xs" | "sm" | "md" | "lg" | "xl""md"Sets the size of the textarea
variant"primary" | "secondary" | "success" | "warning" | "error" | "ghost""primary"Sets the color variant of the textarea
requiredbooleanfalseWhether the textarea is required
wrapperClassstring""Additional CSS classes for the wrapper element
labelClassstring""Additional CSS classes for the label element
labelTextClassstring""Additional CSS classes for the label text
sxReact.CSSProperties{}Custom styles to be applied to the textarea wrapper
rowsnumber3Number of visible text lines

Usage

import { Textarea } from 'knoxui-react';

<Textarea
  label="Description"
  placeholder="Enter your description"
  size="md"
  variant="primary"
  rows={4}
/>

Examples

Basic Usage

Sizes

Variants

Different Row Counts

Required Textarea