Open this example in the interactive library
Source code
<style>
.demo {
field-sizing: content;
min-height: 3rem;
max-height: 8rem;
}
</style>
<textarea class="demo" aria-label="Growing notes">Keep typing</textarea>
Let a textarea grow as you type with native CSS. The preview includes a small shared demo stylesheet.
Open this example in the interactive library
<style>
.demo {
field-sizing: content;
min-height: 3rem;
max-height: 8rem;
}
</style>
<textarea class="demo" aria-label="Growing notes">Keep typing</textarea>