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..." />

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.

Component Props

NameTypeDefaultDescription
value bindablestring''The current value of the textarea.
ref bindableHTMLElementThe 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.
onChange(e: Event) => voidCallback function for the change event.
disabledbooleanfalseDisables the user interaction.
wrapperAttributesHTMLAttributesThe attributes to spread on the wrapper element.
wrapperRef bindableHTMLDivElementThe DOM reference of the wrapper element.
SvelteHTMLElements['textarea']