Textarea API

API documentation for Textarea component

Textarea#

Props#

Defines valid properties in Textarea component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: TextareaInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: TextareaInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<TextareaPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: TextareaInstance) => ReactNode)
null
The children to render.
size"small" | "large"
null
Defines the size of the Textarea.
variant"outlined" | "filled"
null
Specifies the input variant of the component.
fluidboolean
null
When enabled, the component will stretch to occupy the full width of its container.
invalidboolean
false
When present, it specifies that the component should have invalid state style.
autoResizeboolean
false
When present, height of textarea changes as being typed.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by Textarea component.

nametypedefaultdescription
onInput() => void
null
Event handler for input events on the textarea.

Interfaces#

Defines passthrough(pt) options of Textarea component.

nametypedefaultdescription
rootTextareaPassThroughType<InputHTMLAttributes<HTMLInputElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of Textarea component.

values
ComponentInstance<TextareaProps, TextareaState, TextareaExposes>

useTextarea#

Props#

Defines valid properties in useTextarea.

nametypedefaultdescription
autoResizeboolean
false
When present, height of textarea changes as being typed.

Exposes#

Defines the methods and properties exposed by useTextarea.

nametypedefaultdescription
onInput() => void
null
Event handler for input events on the textarea.

Types#

Instance of useTextarea headless.

values
HeadlessInstance<useTextareaProps, useTextareaState, useTextareaExposes>