PHPackages                             hsegura/yii2-widget-alert - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. hsegura/yii2-widget-alert

ActiveYii2-extension[Mail &amp; Notifications](/categories/mail)

hsegura/yii2-widget-alert
=========================

A widget to generate alert based notifications using bootstrap-alert plugin (sub repo split from yii2-widgets)

v1.1.2(6y ago)0691BSD-3-ClausePHP

Since Nov 9Pushed 6y agoCompare

[ Source](https://github.com/hsegura/yii2-widget-alert)[ Packagist](https://packagist.org/packages/hsegura/yii2-widget-alert)[ Docs](https://github.com/kartik-v/yii2-widget-alert)[ RSS](/packages/hsegura-yii2-widget-alert/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (1)Versions (5)Used By (1)

 [ ![Krajee Logo](https://camo.githubusercontent.com/4addfbb3869c3fc7d79befea4f06d9cf3655a686fb503df0da1d725859cfdef9/687474703a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f6b72616a65652d6c6f676f2d622e706e67) ](http://demos.krajee.com "Krajee Demos")
 yii2-widget-alert ---

 [ ![Donate](https://camo.githubusercontent.com/4af77d425ca202e55ab3d711b438e238ded194735bc345a019ac060e03e26227/687474703a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f646f6e6174652e706e67) ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DTP3NZQ6G2AYU "Donate via Paypal")
=====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#------------------------yii2-widget-alert--------------------)

[![Stable Version](https://camo.githubusercontent.com/8fe166d7a51b49cec5a45c0a08a58d46c5bf7ed0a3c8d933c292dfc1e7153607/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d616c6572742f762f737461626c65)](https://packagist.org/packages/kartik-v/yii2-widget-alert)[![Unstable Version](https://camo.githubusercontent.com/ba3d6a33ae545a8bd68436020ee2992a380e1ac8d2f5f78247690ce59ed32f6d/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d616c6572742f762f756e737461626c65)](https://packagist.org/packages/kartik-v/yii2-widget-alert)[![License](https://camo.githubusercontent.com/3ecb60f904cdc0308ac2180f684f2ce61fcfdd03d7a988d1170d36c4d1d7fcc1/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d616c6572742f6c6963656e7365)](https://packagist.org/packages/kartik-v/yii2-widget-alert)[![Total Downloads](https://camo.githubusercontent.com/2e7fb35a799b7145d972d8e84556392f8854c641a6c25d487c15778f340ee64b/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d616c6572742f646f776e6c6f616473)](https://packagist.org/packages/kartik-v/yii2-widget-alert)[![Monthly Downloads](https://camo.githubusercontent.com/7151afd36af293461d0e5c0751c489f989e05d383b8e18dfab2515d1ad5b15ce/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d616c6572742f642f6d6f6e74686c79)](https://packagist.org/packages/kartik-v/yii2-widget-alert)[![Daily Downloads](https://camo.githubusercontent.com/cf33b56b7308199b66b0c4b37c8609391f5325a26e77c314390d0644e031c014/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d616c6572742f642f6461696c79)](https://packagist.org/packages/kartik-v/yii2-widget-alert)

This extension contains a couple of useful widgets. The `Alert` widget extends the `\yii\bootstrap\Alert` widget with more easy styling and auto fade out options. In addition, it includes a `AlertBlock` widget that groups multiple `\kartik\widget\Alert` or `kartik\widget\Growl` widgets in one single block and renders them stacked vertically on the current page. You can choose the `TYPE_ALERT` style or the `TYPE_GROWL` style for your notifications. You can also set the widget to automatically read and display session flash messages (which is the default setting). Alternatively, you can setup and configure your own block of custom alerts.

> NOTE: This extension is a sub repo split of [yii2-widgets](https://github.com/kartik-v/yii2-widgets). The split has been done since 08-Nov-2014 to allow developers to install this specific widget in isolation if needed. One can also use the extension the previous way with the whole suite of [yii2-widgets](http://demos.krajee.com/widgets).

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/). Check the [composer.json](https://github.com/kartik-v/yii2-widget-alert/blob/master/composer.json) for this extension's requirements and dependencies. Read this [web tip /wiki](http://webtips.krajee.com/setting-composer-minimum-stability-application/) on setting the `minimum-stability` settings for your application's composer.json.

To install, either run

```
$ php composer.phar require kartik-v/yii2-widget-alert "*"

```

or add

```
"kartik-v/yii2-widget-alert": "*"

```

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

> NOTE: Using Growl is optional and it is not automatically installed with this extension. If you want to use it in your project, you need to either run

```
$ php composer.phar require kartik-v/yii2-widget-growl "*"

```

or add

```
"kartik-v/yii2-widget-growl": "*"

```

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

> Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-widget-alert/blob/master/CHANGE.md) for details on changes to various releases.

Demo
----

[](#demo)

You can refer detailed documentation and demos for [Alert](http://demos.krajee.com/widget-details/alert) and [AlertBlock](http://demos.krajee.com/widget-details/alert-block) widgets on usage of the extension.

Usage
-----

[](#usage)

### Alert

[](#alert)

```
use kartik\alert\Alert;

echo Alert::widget([
	'type' => Alert::TYPE_INFO,
	'title' => 'Note',
	'titleOptions' => ['icon' => 'info-sign'],
	'body' => 'This is an informative alert'
]);
```

### AlertBlock

[](#alertblock)

```
use kartik\alert\AlertBlock;

echo AlertBlock::widget([
	'type' => AlertBlock::TYPE_ALERT,
	'useSessionFlash' => true
]);
```

License
-------

[](#license)

**yii2-widget-alert** is released under the BSD-3-Clause License. See the bundled `LICENSE.md` for details.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity66

Established project with proven stability

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 ~560 days

Total

4

Last Release

2520d ago

### Community

Maintainers

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

---

Tags

pluginnotificationjqueryyii2extensionwidgetflashbootstrapblockalert

### Embed Badge

![Health badge](/badges/hsegura-yii2-widget-alert/health.svg)

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

###  Alternatives

[kartik-v/yii2-widget-alert

A widget to generate alert based notifications using bootstrap-alert plugin (sub repo split from yii2-widgets)

284.1M24](/packages/kartik-v-yii2-widget-alert)[kartik-v/yii2-widget-growl

A widget to generate growl based notifications using bootstrap-growl plugin (sub repo split from yii2-widgets)

384.2M14](/packages/kartik-v-yii2-widget-growl)[kartik-v/yii2-widget-rating

A Yii2 widget for the simple yet powerful bootstrap-star-rating plugin with fractional rating support (sub repo split from yii2-widgets)

444.1M8](/packages/kartik-v-yii2-widget-rating)[kartik-v/yii2-widget-timepicker

Enhanced Yii2 wrapper for the bootstrap timepicker plugin (sub repo split from yii2-widgets)

404.9M14](/packages/kartik-v-yii2-widget-timepicker)[kartik-v/yii2-widget-switchinput

A Yii2 wrapper widget for the Bootstrap Switch plugin to use checkboxes &amp; radios as toggle switchinputes (sub repo split from yii2-widgets)

384.4M13](/packages/kartik-v-yii2-widget-switchinput)[kartik-v/yii2-widget-sidenav

An enhanced side navigation menu styled for bootstrap (sub repo split from yii2-widgets)

364.0M8](/packages/kartik-v-yii2-widget-sidenav)

PHPackages © 2026

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