Textarea

Multiline field with a spring caret and its own themed scroll area.

Usage

svelte
<script lang="ts">
  import { Textarea } from "@milandekruijf/ui/svelte";

  let value = $state("");
</script>

<Textarea bind:value rows={5} placeholder="Write a message…" />

Examples

Multiline field
<script lang="ts">
  import { css } from "@milandekruijf/pandacss/css";
  import { Textarea } from "@milandekruijf/ui/svelte";

  let value = $state("");

  const wrapClass = css({ maxW: "28rem", minW: 0 });
</script>

<div class={wrapClass}>
  <Textarea bind:value rows={5} placeholder="Write a message…" />
</div>

Props

PropTypeDefaultDescription
value?string""
Bindable editor text (`bind:value`).
rows?number6
Approximate visible line count before scrolling.
placeholder?string—
Shown while the editor is empty.
name?string—
Form field name.
form?string—
Associates the editor with a form by id.
required?booleanfalse
Marks the field as required.
disabled?booleanfalse
Disables the editor.
readonly?booleanfalse
Keeps the text selectable but not editable.
autofocus?booleanfalse
Focuses the editor on mount.
onValueChange?(value: string) => void—
Fires after the value syncs from the editor (for form libraries).
class?string—
Extra classes merged after the field styles.

Remaining native attributes are forwarded to the editor surface.