بسم الله الرحمن الرحيم

Update Note

If you're using Filament Forms textarea field, there's an optional autosize() method that you could use to apply a similar logic internally real-quick. And therefore, you wouldn't need this package.

AlpineJS Extending Textarea

An AlpineJS plugin to ensure that the text-area expands as it has more input than its height can fit.

Until form-sizing CSS attribute is resolved, this is a swift solution for now.

Installation

  1. Use your favorite package manager to install the dependency in your TALL project:

    bun add alpinejs-extending-textarea
  2. Then initialize the Alpine plugin in your flow JS like this:

    // import { Livewire, Alpine } from '../../../vendor/livewire/livewire/dist/livewire.esm';
    import ExtendingTextarea from 'alpinejs-extending-textarea';
    
    Alpine.plugin(ExtendingTextarea);
    
    // Alpine.start();

Usage

  • Simply just add x-extending-textarea to your textarea element and you're good to go!

    <textarea x-extending-textarea></textarea>

Support

Support ongoing package maintenance as well as the development of other projects through sponsorship or one-time donations if you prefer.

And may Allah accept your strive; aameen.

License

This package is open-sourced software licensed under the MIT license.

Credits

Inspiration


والحمد لله رب العالمين