@aroleaf/svelte-textarea-autoresize

1.1.0 • Public • Published

Svelte Textarea Autoresize

An autoresizing textarea component that adjusts it's height based on it's content. Based on the wonderful andarist/react-textarea-autosize.

Install

$ npm install svelte-textarea-autoresize

Demo

https://dyl.dog/svelte-textarea-autoresize/

Use

You can either use the component as is:

<script>
  import AutoresizingTextArea from 'svelte-textarea-autoresize'
</script>

<AutoresizingTextArea placeholder="Type something long into me.." />

or by using the exported autoresize function on your existing component like so:

<script>
  import { autoresize } from 'svelte-textarea-autoresize'
</script>

<textarea use:autoresize placeholder="Type something long into me.." />

Package Sidebar

Install

npm i @aroleaf/svelte-textarea-autoresize

Weekly Downloads

2

Version

1.1.0

License

none

Unpacked Size

8.96 kB

Total Files

12

Last publish

Collaborators

  • aroleaf