PHPackages                             asmitta-01/toast-bundle - 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. [Templating &amp; Views](/categories/templating)
4. /
5. asmitta-01/toast-bundle

ActiveSymfony-bundle[Templating &amp; Views](/categories/templating)

asmitta-01/toast-bundle
=======================

UX Toast display for your Symfony project.

v0.4.1(1mo ago)114[1 issues](https://github.com/Asmitta-01/toast-bundle/issues)MITTwigPHP &gt;=8.1CI passing

Since Oct 6Pushed 1mo agoCompare

[ Source](https://github.com/Asmitta-01/toast-bundle)[ Packagist](https://packagist.org/packages/asmitta-01/toast-bundle)[ Docs](https://github.com/Asmitta-01/toast-bundle)[ RSS](/packages/asmitta-01-toast-bundle/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (6)Dependencies (70)Versions (7)Used By (0)

ToastBundle
===========

[](#toastbundle)

[![Static Analysis](https://github.com/Asmitta-01/toast-bundle/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/Asmitta-01/toast-bundle/actions/workflows/static-analysis.yml)

A Symfony bundle for displaying toast notifications from flash messages, with no Bootstrap CSS or JavaScript dependency.

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

[](#installation)

Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

Open a command console, enter your project directory and execute:

```
composer require asmitta-01/toast-bundle
```

The bundle is compatible with Symfony 6, 7 and 8.

If your application exposes bundle assets through the public directory, install them after requiring the package:

```
php bin/console assets:install
```

Configuration
-------------

[](#configuration)

If your application doesn't use Symfony Flex, enable the bundle in `config/bundles.php`:

```
return [
    // ...
    Asmitta\ToastBundle\AsmittaToastBundle::class => ['all' => true],
];
```

Create a configuration file at `config/packages/asmitta_toast.yaml`, see [docs/config.md](./docs/config.md).

Usage
-----

[](#usage)

### 1. Add flash messages in your controller

[](#1-add-flash-messages-in-your-controller)

```
use Asmitta\ToastBundle\Enum\ToastType;

public function someAction(Request $request): Response
{
    $this->addFlash('success', 'Operation completed successfully!'); // 'success' or ToastType::SUCCESS->value
    $this->addFlash('warning', 'Please check your input.');
    $this->addFlash('error', 'Something went wrong.');
    $this->addFlash('info', 'Here is some information.');

    return $this->render('your_template.html.twig');
}
```

### 2. Render toasts in your template

[](#2-render-toasts-in-your-template)

```
{{ render_toasts() }}
```

By default, the bundle automatically loads its CSS and JavaScript assets when rendering toasts.

If you use the `with_icon` or `colored_icon` templates, include Bootstrap Icons in your page:

```

```

### 3. Optional: disable automatic asset loading

[](#3-optional-disable-automatic-asset-loading)

If you prefer to manage assets manually (for example with your own pipeline), disable auto loading:

```
asmitta_toast:
    auto_load_assets: false
```

Then include the assets yourself:

```

```

Toast Types
-----------

[](#toast-types)

The bundle supports these flash message types:

- `success` → Green toast
- `warning` → Yellow toast
- `error` or `danger` → Red toast
- `info` (default) → Light Blue toast

Features
--------

[](#features)

- Automatic mapping of flash message types to toast variants
- Configurable auto-hide timer (default: 5 seconds)
- Flexible positioning (7 positions available, see [ToastPosition Enum](./src/Enum/ToastPosition.php))
- Limit maximum toasts per type
- Optional progress bar showing remaining time
- Dismissible toasts with close button
- Responsive design
- Twig template-based rendering
- Full configuration support
- No Bootstrap CSS or JavaScript dependency
- Symfony 6, 7 and 8 compatibility
- Automatic CSS/JS loading by default

Breaking Changes In 0.4.0
-------------------------

[](#breaking-changes-in-040)

- The root toast class changed from `toast` to `asmitta-toast`
- Bootstrap toast classes and utility classes were replaced by `asmitta-` prefixed classes
- Bootstrap JavaScript is no longer used or required for rendering toasts

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance71

Regular maintenance activity

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

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

Recently: every ~67 days

Total

6

Last Release

44d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/69441849?v=4)[Brayan Tiwa](/maintainers/Asmitta-01)[@Asmitta-01](https://github.com/Asmitta-01)

---

Top Contributors

[![Asmitta-01](https://avatars.githubusercontent.com/u/69441849?v=4)](https://github.com/Asmitta-01 "Asmitta-01 (16 commits)")

---

Tags

bootstrapbundleflashmessagesymfonysymfony6symfony7symfony8templatetoasttwigsymfonybootstraptoastux

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/asmitta-01-toast-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/asmitta-01-toast-bundle/health.svg)](https://phpackages.com/packages/asmitta-01-toast-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k18.3M427](/packages/easycorp-easyadmin-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M672](/packages/shopware-core)[chameleon-system/chameleon-base

The Chameleon System core.

1029.4k6](/packages/chameleon-system-chameleon-base)[sylius/sylius

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

8.5k6.0M777](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[contao/core-bundle

Contao Open Source CMS

1301.7M3.1k](/packages/contao-core-bundle)

PHPackages © 2026

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