Skip to content
alpine-autosize / 1.1.0

alpine-autosize 1.1.0

Install from the command line:
Learn more about npm packages
$ npm install @marcreichel/alpine-autosize@1.1.0
Install via package.json:
"@marcreichel/alpine-autosize": "1.1.0"

About this version

↕️ Alpine Autosize ↕️

A little Alpine.js plugin to automatically resize a textarea to fit its content.

version Build size JSDelivr GitHub

🚀 Installation

CDN

Include the following <script> tag in the <head> of your document, just before Alpine.

<script src="https://cdn.jsdelivr.net/npm/@marcreichel/alpine-autosize@latest/dist/alpine-autosize.min.js" defer></script>

NPM

npm install @marcreichel/alpine-autosize

Add the x-autosize directive to your project by importing the package before Alpine.js.

import Alpine from 'alpinejs';
import Autosize from '@marcreichel/alpine-autosize';

Alpine.plugin(Autosize);

window.Alpine = Alpine;
window.Alpine.start();

🪄 Usage

To let the textarea automatically resize, add the x-data and x-autosize directives to the <textarea>.

<textarea x-data x-autosize></textarea>

That's it!

🐛 Known issues

  • When the textarea has a wire:model the size of the textarea is not calculated correctly. (#1)

📄 License

Copyright (c) 2022 Marc Reichel and contributors.

Licensed under the MIT license, see LICENSE for details.

Details


Assets

  • alpine-autosize-1.1.0-npm.tgz

Download activity

  • Total downloads 0
  • Last 30 days 0
  • Last week 0
  • Today 0