View as Markdown

API reference: @salmonui/inputs/text-field

TextAreacomponent

import { TextArea } from '@salmonui/inputs/text-field';
function TextArea(props: TextAreaProps): ReactNode;

Multi-line text input (TextBox multiline): a native <textarea>. ref is the textarea.

Props: TextAreaProps

TextArea props (20)
NameSignatureDescription
labeloptionalinheritedlabel?: ReactNode;
descriptionoptionalinheriteddescription?: ReactNode;
errorMessageoptionalinheritederrorMessage?: ((ctx: { readonly errors: readonly string[]; }) => ReactNode) | ReactNode;

Error text (or a function of the errors) shown while the field is invalid.

invalidoptionalinheritedinvalid?: boolean;

Forces the error state.

resizeoptionalreadonly resize?: 'vertical' | 'horizontal' | 'both' | 'none' | undefined;

Native resize handle. Default 'both'.

autoResizeoptionalreadonly autoResize?: boolean | undefined;

Grows with its content: field-sizing: content, one scrollHeight read per input where unsupported.

refoptionalreadonly ref?: Ref<HTMLTextAreaElement> | undefined;

The native <textarea>.

validationoptionalinheritedvalidation?: FieldValidation;

Rules in the Data Grid vocabulary.

validateOnoptionalinheritedvalidateOn?: ValidateOn;

When errors appear; default the Form's, else 'blur'.

sizeoptionalinheritedsize?: FieldSize;

Metric set. Default 'md'.

valueoptionalinheritedvalue?: string;
defaultValueoptionalinheriteddefaultValue?: string;
onValueChangeoptionalinheritedonValueChange?: ((value: string, details: TextChangeDetails) => void);
clearableoptionalinheritedclearable?: boolean;

Shows a clear button while there is a value; Escape clears too.

startAdornmentoptionalinheritedstartAdornment?: ReactNode;
endAdornmentoptionalinheritedendAdornment?: ReactNode;
localeTextoptionalinheritedlocaleText?: TextFieldLocaleText;
classNameoptionalinheritedclassName?: string;

Root class and style (the input gets every other prop).

styleoptionalinheritedstyle?: CSSProperties;
classNamesoptionalinheritedclassNames?: { readonly group?: string; readonly input?: string; readonly label?: string; readonly description?: string; readonly error?: string; };

Part classes: root is className; group, input, label, description, error.