TextArea
TextArea component with label support and error handling
TextArea component with label support and error handling
import { TextArea } from "@tetherto/mdk-react-devkit";| Prop | Status | Type | Default | Description |
|---|---|---|---|---|
error | Optional | string | undefined | — | Validation error message. When provided, displays error styling (red border) and the message below the textarea. |
label | Optional | string | undefined | — | Optional label displayed above the textarea |
wrapperClassName | Optional | string | undefined | — | Custom className for the root wrapper |
Usage
A multi-line text input with optional label, error message, and accessible markup. Renders as a <textarea> element.
Notes
- When an
erroris provided, the textarea receivesaria-invalidandaria-describedbypointing to the error message for screen reader accessibility. - When no
labelis provided,wrapperClassNameis applied directly to the inner wrapperdiv; when a label is present, it applies to the outer rootdiv.
Example
/** * Runnable example for TextArea. */import { TextArea } from '@tetherto/mdk-react-devkit'export const TextAreaExample = () => ( <div className="mdk-example-col"> <TextArea id="notes" label="Device Notes" placeholder="Add notes about this miner..." rows={4} /> <TextArea id="config" label="Custom Configuration" placeholder="Paste raw config JSON..." rows={6} /> <TextArea id="error-ta" label="Pool URL" placeholder="stratum+tcp://..." error="Invalid stratum URL format." /> <TextArea id="disabled-ta" label="Read-only Log" defaultValue="2025-05-18 12:34:56 — Pool connected successfully." disabled rows={3} /> </div>)