Textarea

A multi-line text input field for longer form content.

Anatomy

<script>
  import { Textarea } from "@saas-ui/svelte/components/textarea";
</script>

<Textarea placeholder="Enter description..." />

<!-- Auto-resizing textarea -->
<Textarea.Autoresize placeholder="Auto-grows as you type..." />

Examples

Autoresize Accessibility

Use Textarea.Autoresize for auto-expanding textareas.

Basic Accessibility

Basic textarea with default styling.

Error Text Accessibility

Use Field.ErrorText to show validation errors.

Field Accessibility

Use Field.Root to wrap the textarea with label and helper text.

Helper Text Accessibility

Use Field.HelperText to add helper text below the textarea.

Hook Form Accessibility

Example form with textarea and input fields.

Resize Accessibility

Use the resize prop to control resize behavior.

Sizes Accessibility

Use the size prop to change the size of the textarea.

Variants Accessibility

Use the variant prop to change the visual style.

Props

Prop Type Default Description
variant outline | subtle | flushed outline The visual style of the textarea.
size xs | sm | md | lg | xl md The size of the textarea.
invalid boolean false Whether the textarea is in an invalid state.
disabled boolean false Whether the textarea is disabled.
class text - CSS class to apply to the component.