PHPackages                             sandritsch91/yii2-widget-autosize - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sandritsch91/yii2-widget-autosize

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

sandritsch91/yii2-widget-autosize
=================================

An autosize widget for yii2

1.0.0(2y ago)0441MITPHPPHP &gt;=8.0

Since Apr 16Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Sandritsch91/yii2-widget-autosize)[ Packagist](https://packagist.org/packages/sandritsch91/yii2-widget-autosize)[ RSS](/packages/sandritsch91-yii2-widget-autosize/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

yii2-widget-autosize
====================

[](#yii2-widget-autosize)

An [autosize](https://www.jacklmoore.com/autosize/) widget for [yii2](https://www.yiiframework.com/)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist sandritsch91/yii2-widget-autosize
```

or add

```
"sandritsch91/yii2-widget-autosize": "*"
```

to the require section of your composer.json

Usage
-----

[](#usage)

with a model:

```
use sandritsch91\yii2-widget-autosize\Autosize;

echo Autosize::widget([
    'model' => $model,                          // The model to be used in the form
    'attribute' => 'content',                   // The attribute to be used in the form
    'htmlClass' => yii\bootstrap5\Html::class,  // Optional. The class used to generate the form field
    'clientEvents' => [                         // Optional. Pass the client events to be attached to the textarea
        'autosize:resized' => 'function() { console.log("resized"); }'
    ]
]);
```

with an ActiveForm:

```
use sandritsch91\yii2-widget-autosize\Autosize;

echo $form->field($model, 'content')->widget(Autosize::class, [
    'clientEvents' => [
        'autosize:resized' => 'function() { console.log("resized"); }'
    ]
]);
```

without a model:

```
use sandritsch91\yii2-widget-autosize\Autosize;

echo Autosize::widget([
    'name' => 'myText',         // The name of the input
    'value' => 'Hello World',   // The value of the input
    'clientEvents' => [
        'autosize:resized' => 'function() { console.log("resized"); }'
    ]
]);
```

Widget options
--------------

[](#widget-options)

- clientEvents: The client events to be attached to the textarea. Defaults to \[\]
    - autosize:resized: Triggered when the textarea is resized
    - autosize:update: Dispatch this event to update the textarea. No event is triggered by the plugin
    - autosize:destroy: Dispatch this event to destroy the textarea. No event is triggered by the plugin
- htmlClass: The class used to generate the form field. Defaults to yii\\helpers\\Html::class

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

757d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/239a4e22e3970ec416269e7fd1b42b26005057eb971076bb204cb6cd80b5642d?d=identicon)[Sandritsch91](/maintainers/Sandritsch91)

---

Top Contributors

[![Sandritsch91](https://avatars.githubusercontent.com/u/17873124?v=4)](https://github.com/Sandritsch91 "Sandritsch91 (4 commits)")

---

Tags

yii2widgettextareaautosize

### Embed Badge

![Health badge](/badges/sandritsch91-yii2-widget-autosize/health.svg)

```
[![Health](https://phpackages.com/badges/sandritsch91-yii2-widget-autosize/health.svg)](https://phpackages.com/packages/sandritsch91-yii2-widget-autosize)
```

###  Alternatives

[softark/yii2-dual-listbox

Bootstrap Dual Listbox Widget for Yii 2

20144.4k11](/packages/softark-yii2-dual-listbox)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
