Skip to content
Control Components

Textarea

A multi-line text input field, in the spirit of the HTML <textarea> element.

Integrates the tweakpane-textarea-plugin by Krzysztof GoliΕ„ski and Jakub KoΕΊniewski.

Extends the underlying implementation with the live property to match the behavior of the <Text> component.

Usage outside of a <Pane> component will implicitly wrap the text area in <Pane position="inline">.

Note that Svelte Tweakpane UI embeds a functionally identical fork of the plugin with build optimizations. The fork also changes the package name from @pangenerator/tweakpane-textarea-plugin to @kitschpatrol/tweakpane-plugin-textarea for consistency with other plugins.


Example

πŸ”—
TextareaExample.svelte
<script lang="ts">
import { Textarea } from 'svelte-tweakpane-ui';
let text = '';
</script>
<Textarea bind:value={text} placeholder="The void" rows={8} />
<pre>{text}</pre>

bindablerequired
Description

A string value to control. The value to control.

Typestring
optional
Description

Whether to provide live updates to the bound value on every keystroke.

Typeboolean
Defaulttrue

placeholder

πŸ”—
optional
Description

Placeholder text to display when the value is empty.

Typestring
Default'Enter text here'
optional
Description

The number of lines of text to display.

If lines of input exceed this value, then the text area will scroll.

Typenumber
Default3

disabled

πŸ”—
optional
Description

Prevent interactivity and gray out the control.

Typeboolean
Defaultfalse
optional
Description

Text displayed next to control.

Typestring
Defaultundefined
optional
Description

Custom color scheme.

TypeTheme
Defaultundefined
Inherits default Tweakpane theme equivalent to ThemeUtils.presets.standard, or the theme set with setGlobalDefaultTheme().

Events

πŸ”—

change

πŸ”—
Description

Fires when value changes.

This event is provided for advanced use cases. It's usually preferred to bind to the value prop instead.

The event.details payload includes a copy of the value and an origin field to distinguish between user-interactive changes (internal) and changes resulting from programmatic manipulation of the value (external).

ExtendsValueChangeEvent
TypeTextareaChangeEvent