Skip to main content

TextareaAutosize

Automatically update the height of a textarea depending on the content.

Demo

Usage

		<script lang="ts">
	import { TextareaAutosize } from "runed";
 
	let el = $state<HTMLTextAreaElement>(null!);
	let value = $state("");
	new TextareaAutosize({
		element: () => el,
		input: () => value
	});
</script>
 
<textarea bind:this={el} bind:value></textarea>