Alpine Autosize Save

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

Project README

↕️ Alpine Autosize ↕️

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

version Build size downloads 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 starting Alpine.

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

Alpine.plugin(Autosize);

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>

📄 License

Copyright (c) 2022 - 2023 Marc Reichel and contributors.

Licensed under the MIT license, see LICENSE for details.

Open Source Agenda is not affiliated with "Alpine Autosize" Project. README Source: marcreichel/alpine-autosize
Stars
87
Open Issues
0
Last Commit
7 months ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating