PHPackages                             pentiminax/ux-sweet-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. pentiminax/ux-sweet-alert

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

pentiminax/ux-sweet-alert
=========================

SweetAlert2 integration for Symfony

v0.17.0(2mo ago)254.4k↓17.4%1MITPHPPHP &gt;=8.2CI passing

Since Jul 3Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/pentiminax/ux-sweet-alert)[ Packagist](https://packagist.org/packages/pentiminax/ux-sweet-alert)[ Docs](https://github.com/pentiminax/ux-sweet-alert)[ RSS](/packages/pentiminax-ux-sweet-alert/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (42)Used By (0)

UX SweetAlert
=============

[](#ux-sweetalert)

UX SweetAlert is a Symfony bundle that integrates the SweetAlert2 library into your Symfony applications. It provides PHP helpers and a Stimulus controller to easily display alerts and toast notifications.

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- Symfony StimulusBundle
- Composer

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

[](#installation)

Install the library via Composer:

```
composer require pentiminax/ux-sweet-alert
```

Basic usage
-----------

[](#basic-usage)

To automatically display toasts and alerts in your templates, add the following Twig function in your base.html.twig (or the layout file):

```
{{ ux_sweet_alert_scripts() }}
```

Alerts
------

[](#alerts)

Inject the AlertManagerInterface and use the helper methods to create alerts:

```
use Pentiminax\UX\SweetAlert\AlertManagerInterface;

#[Route('/', name: 'app_homepage')]
public function index(AlertManagerInterface $alertManager): Response
{
    $alertManager->success(
        title: 'Update Successful',
        text: 'Your settings have been saved.'
    );

    return $this->redirectToRoute('dashboard');
}
```

Toasts
------

[](#toasts)

Use the `AlertManagerInterface` service with the `toast()` method to create toast notifications:

```
use Pentiminax\UX\SweetAlert\AlertManagerInterface;
use Pentiminax\UX\SweetAlert\Enum\Position;

class HomeController extends AbstractController
{
    #[Route('/', name: 'app_homepage')]
    public function index(AlertManagerInterface $alertManager): Response
    {
       $alertManager->toast(
            title: 'title',
            text: 'text',
            position: Position::TOP_END,
            timer: 3000,
            timerProgressBar: true
        );

        return $this->render('home/index.html.twig');
    }
}
```

Documentation
-------------

[](#documentation)

- [Online documentation](https://pentiminax.github.io/ux-sweet-alert/)

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance82

Actively maintained with recent releases

Popularity33

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.6% 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 ~6 days

Total

37

Last Release

89d ago

### Community

Maintainers

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

---

Top Contributors

[![pentiminax](https://avatars.githubusercontent.com/u/4866668?v=4)](https://github.com/pentiminax "pentiminax (126 commits)")[![tlemarie](https://avatars.githubusercontent.com/u/146178261?v=4)](https://github.com/tlemarie "tlemarie (44 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![clementtalleu](https://avatars.githubusercontent.com/u/11056924?v=4)](https://github.com/clementtalleu "clementtalleu (1 commits)")

---

Tags

javascriptsweetalert2symfony-bundlesymfony-uxuxsymfony-uxsweet-alert

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/pentiminax-ux-sweet-alert/health.svg)

```
[![Health](https://phpackages.com/badges/pentiminax-ux-sweet-alert/health.svg)](https://phpackages.com/packages/pentiminax-ux-sweet-alert)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[symfony/ux-chartjs

Chart.js integration for Symfony

1003.2M18](/packages/symfony-ux-chartjs)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[pentiminax/ux-datatables

DataTables.net integration for Symfony

605.6k](/packages/pentiminax-ux-datatables)[symfony/ux-notify

Native notification integration for Symfony

1274.7k](/packages/symfony-ux-notify)[symfony/ux-lazy-image

Lazy image loader and utilities for Symfony

36335.2k](/packages/symfony-ux-lazy-image)

PHPackages © 2026

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