enes

TextArea

Textarea allows the user to enter and edit multiline text.

Usage

<script>
	import { TextArea } from 'fluentui-svelte';
</script>

<TextArea placeholder="Type your message here..." />

Shape

Set shape to rounded (default) or square.

Placeholder

The placeholder prop sets the placeholder text for the textarea, providing a hint to users about what to enter.

Resize

The resize prop controls whether the textarea can be resized by the user. It can be set to none, both, horizontal, or vertical. This allows you to control the resizing behavior of the textarea.

On Change

The onChange event is triggered whenever the content of the textarea changes. This can be used to react to user input in real-time, such as validating input or updating other parts of the UI.

Form Control Attributes

Attributes and events apply to the native form field; ref gives you access to it. For the container, use wrapperAttributes and wrapperRef.

Component Props

NameTypeDefaultDescription
shapeExclude<Shapes, 'circular'>'rounded'Shape of the input surface, including its border and focus indicator.
value bindablestring''The current value of the textarea.
ref bindableHTMLTextAreaElement | nullThe DOM reference of the textarea element.
placeholderstringThe placeholder text for the textarea.
resize'none' | 'both' | 'horizontal' | 'vertical''vertical'Configures the resize behavior of the textarea.
disabledbooleanfalseDisables the user interaction.
wrapperAttributesHTMLAttributesThe attributes to spread on the wrapper element.
wrapperRef bindableHTMLDivElement | nullThe DOM reference of the wrapper element.
SvelteHTMLElements['textarea']
Edit this Doc View as Markdown