Basic usage

Text areas allow users to input and edit a longer amount of custom text than a text field. Text areas often have input requirements indicated by their label, ghost text, and/or error state.

Error

Props

Textarea
NameTypeDescription
size"small" | "medium" | "large"Size of input
disabledbooleandisabled input
placeholderstringDefault browser placeholder value will be used if no label is provided
readOnlybooleanread only input
valuestring | (string & readonly string[])Value for input
onChange(((event: FormEvent<HTMLInputElement>) => void) & ((event: ChangeEvent<HTMLInputElement>) => void)) | (((event: FormEvent<HTMLInputElement>) => void) & ((event: ChangeEvent<...>) => void))Callback fired when the value is changed
defaultValuestring | (string & readonly string[])Value for uncontrolled input
labelTextstringGhost/floating label. If both placeholder and label are provided, label will be in `docked` mode
helperTextstringAdditional text to help guide user
errorbooleanError / Danger mode
placeholderVariant"docked" | "animated" | "static"animated, docked, static
isMultilinebooleanRender textarea if true
elementBeforeReactNode16x16 element to render before input cursor. Most cases should be an icon. Does not play nice with labelText / ghost label
elementAfterReactNode16x16 element to render after cursor. Most cases should be an icon
secondElementAfterReactNodeA second 16x16 element to render after cursor. Most cases should be an icon
isRequiredbooleanrequired input
requiredIndicatorstringrequired indicator, default is *
wrapperPropsPick<Pick<Pick<any, string | number | symbol> & Partial<Pick<any, never>>, string | number | symbol> & { theme?: any; } & { as?: string | ComponentClass<any, any> | FunctionComponent<...>; forwardedAs?: string | ... 1 more ... | FunctionComponent<...>; }, string | ... 1 more ... | symbol> | Pick<...>box props to be passed on the input wrapper (e.g. to set external margins)
rowsnumberNumber of rows to show without scrollbar
resize"none" | "both" | "horizontal" | "vertical"Resize knob
Autogrow

Not available yet in houzz-ui