PHPackages                             jlorente/yii2-widget-remainingcharacters - 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. jlorente/yii2-widget-remainingcharacters

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

jlorente/yii2-widget-remainingcharacters
========================================

Widget to add a remaining character counter to text inputs and textareas

1.0.1(11y ago)534.4k↑30%32MITPHP

Since Mar 2Pushed 11y ago2 watchersCompare

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

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

Yii2 Remaining Characters Widget
================================

[](#yii2-remaining-characters-widget)

RemainingCharacters widget is a Yii2 wrapper for the jquery-remaining-characters jQuery plugin [Remaining Characters jQuery plugin](https://github.com/jlorente/jquery-remaining-characters). This input widget is a replacement for text and textarea inputs. It appends a container with a countdown counter of characters to the input.

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/). Check the [composer.json](https://github.com/jlorente/yii2-widget-remainingcharacters/composer.json) for this extension's requirements and dependencies.

To install, either run

```
$ php composer.phar require jlorente/yii2-widget-remainingcharacters "*"
```

or add

```
...
    "require": {
        ...
        "jlorente/yii2-widget-remainingcharacters": "*"
    }
```

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

```
use jlorente\remainingcharacters\RemainingCharacters;

//
echo $form->field($model, 'my-textarea')->widget(RemainingCharacters::classname(), [
    'type' => RemainingCharacters::INPUT_TEXTAREA,
    'text' => Yii::t('app', '{n} characters remaining'),
    'label' => [
        'tag' => 'p',
        'id' => 'my-counter',
        'class' => 'counter',
        'invalidClass' => 'error'
    ],
    'options' => [
        'rows' => '3',
        'class' => 'col-md-12',
        'maxlength' => 200,
        'placeholder' => Yii::t('app', 'Write something')
    ]
]);
```

Where options array are the options for the textarea.

### Options

[](#options)

OptionTypeDefaultDescriptiontypestringRemainingCharacters::INPUT\_TEXTAREAType of the input. Must be RemainingCharacters::INPUT\_TEXTAREA or RemainingCharacters::INPUT\_TEXTtextstring'{n}'Text to display inside the label where {n} is the placeholder of the remaining characters counter. i.e.: '{n} characters remaining'labelarrayOptions related to the label containerlabel.tagstring'p'Html tag of the labellabel.idstringnullId of the labellabel.classstring'char-counter'Class of the labellabel.invalidClassstring'error'Class to add to the label if the counter reaches an invalid numberoptionsarrayOptions for the input text or textarea. See ActiveField::textarea() or ActiveField::textInput() for more informationLicense
-------

[](#license)

Copyright © 2015 José Lorente Martín. Licensed under the MIT license. See LICENSE.txt for details.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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

Every ~15 days

Total

2

Last Release

4080d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b5b6d568331349beaf1945db65a076cf60e6c124d504fcb43a21937f0c85bde3?d=identicon)[jlorente](/maintainers/jlorente)

---

Top Contributors

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

---

Tags

textcounterinputtextarearemainingcharacters

### Embed Badge

![Health badge](/badges/jlorente-yii2-widget-remainingcharacters/health.svg)

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

###  Alternatives

[froala/yii2-froala-editor

A beautiful WYSIWYG HTML text editor based on HTML5 technology. Cross browser, with mobile support, high performance and Retina Ready modern design.

109229.5k6](/packages/froala-yii2-froala-editor)[aneeshikmat/yii2-time-down-counter

Widget for yii2, to start count down timer with a lot of options, This widget build dependence of timeDownCounter JS library

1546.0k](/packages/aneeshikmat-yii2-time-down-counter)

PHPackages © 2026

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