PHPackages                             sandritsch91/yii2-widget-jsignature - 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-jsignature

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

sandritsch91/yii2-widget-jsignature
===================================

A jSignature widget for Yii2

1.1.3(4mo ago)01611MITPHPPHP &gt;=8.0

Since Jul 18Pushed 4mo ago1 watchersCompare

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

READMEChangelog (5)Dependencies (3)Versions (6)Used By (0)

yii2-widget-jsignature
======================

[](#yii2-widget-jsignature)

A [jSignature](https://github.com/brinley/jSignature) 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-jsignature
```

or add

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

to the require section of your composer.json

Good to know
------------

[](#good-to-know)

Loading a signature is only supported for the following formats:

- native
- base30

If you need to load a signature again, use one of these formats.

Usage
-----

[](#usage)

### Widget

[](#widget)

with a model:

```
use sandritsch91\yii2\jSignature\JSignature;

echo JSignature::widget([
    'model' => $model,                          // The model to be used in the form
    'attribute' => 'signature',                 // The attribute to be used in the form
    'format' => 'svgbase64',                    // The format of the signature. Defaults to svgbase64
    'htmlClass' => yii\helpers\Html::class,     // Optional. The class used to generate the form field
    'clientOptions' => [],                      // Optional. The options for the jSignature plugin
    'clientEvents' => [                         // Optional. Pass the client events to be attached to the textarea
        'change' => 'function() { console.log("changed"); }'
    ],
    'wrapperOptions' => [...]                   // Optional. The options for the wrapper div
]);
```

with an ActiveForm:

```
use sandritsch91\yii2\jSignature\JSignature;

echo $form->field($model, 'content')->widget(JSignature::class, [
    'format' => 'svgbase64',                    // The format of the signature. Defaults to svgbase64
    'htmlClass' => yii\helpers\Html::class,     // Optional. The class used to generate the form field
    'clientEvents' => [                         // Optional. Pass the client events to be attached to the textarea
        'change' => 'function() { console.log("changed"); }'
    ],
    'wrapperOptions' => [...]                   // Optional. The options for the wrapper div
]);
```

without a model:

```
use sandritsch91\yii2\jSignature\JSignature;

echo JSignature::widget([
    'name' => 'myText',                         // The name of the input
    'value' => ...,                             // The value of the input, depends on the format
    'format' => 'svgbase64',                    // The format of the signature. Defaults to svgbase64
    'htmlClass' => yii\helpers\Html::class,     // Optional. The class used to generate the form field
    'clientEvents' => [                         // Optional. Pass the client events to be attached to the textarea
        'change' => 'function() { console.log("changed"); }'
    ],
    'wrapperOptions' => [...]                   // Optional. The options for the wrapper div
]);
```

### Widget options

[](#widget-options)

- format: The format of the signature. Defaults to svgbase64
    - default
    - native
    - base30
    - svg
    - svgbase64
    - image
- htmlClass: The class used to generate the form field. Defaults to yii\\helpers\\Html::class
- clientEvents: The client events to be attached to the textarea. Defaults to \[\]
    - change: Triggered after each stroke
- wrapperOptions: The options for the wrapper div. Defaults to \[\]

### Helper

[](#helper)

User the `sandritsch91\yii2\jSignature\JSignatureHelper` to convert the signature to a different format.

Possible conversions are:

- base30 to native
- native to svg
- base30 to svg
- native to image
- base30 to image

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance77

Regular maintenance activity

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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

Every ~135 days

Total

5

Last Release

126d 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 (11 commits)")

---

Tags

yii2extensionwidgetjSignature

### Embed Badge

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

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

###  Alternatives

[bizley/contenttools

ContentTools editor implementation for Yii 2.

8016.7k](/packages/bizley-contenttools)[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)
