Skip to content

Introduction ​

Inertia Notifications adds toasts, a notification center, and notification preferences to Laravel applications that use Inertia.js. You may use it with Vue 3 or React 19. It's part of Inertia UI, a suite of packages for Laravel, Inertia.js, and Tailwind CSS.

Quick Example ​

You may flash a toast from any controller. The Toaster component shows it after the next Inertia response:

php
use App\Http\Requests\UpdateProfileRequest;
use InertiaUI\Notifications\Toast;

class ProfileController extends Controller
{
    public function update(UpdateProfileRequest $request)
    {
        $request->user()->update($request->validated());

        Toast::success('Profile saved')
            ->description('Your changes are live.')
            ->flash();

        return back();
    }
}

The notification center keeps Laravel notifications for users to read later. Its NotificationCenter component shows them in a panel under a bell that counts new notifications. A notification whose via method returns the inbox channel appears in the panel once you send it:

php
$invoice = Invoice::find(1);

$invoice->user->notify(new InvoicePaid($invoice));

Getting Started ​

The package has three parts:

  • The inertiaui/notifications Composer package, with the Toast class and the inbox notification channel.
  • The @inertiaui/notifications-vue package for Vue 3.
  • The @inertiaui/notifications-react package for React 19.

Continue with the requirements and the installation.

Free and Open Source ​

Inertia Notifications is free and open source under the MIT license, so you may use it in personal and commercial projects. Its source code is on GitHub, where you may report issues and send pull requests. To support its development, you may sponsor it on GitHub.

Other Inertia UI Packages ​

Inertia UI is built and maintained by Pascal Baljet. Its other packages work with the same stack:

  • Inertia Forms defines forms in PHP and renders them with one Vue or React component, with validation, file uploads, conditional fields, and multi-step flows. It's a commercial package.
  • Inertia Table turns one PHP class into a data table with sorting, filtering, exports, saved views, and bulk actions, also across relationships. It's a commercial package.
  • Inertia Modal turns any Laravel route into a modal or slideover with one component, including nested modals. It's free and open source.

Every Inertia UI package builds on Inertia UI Vanilla, our own lightweight library for dialogs, focus management, keyboard navigation, and positioning. The Vue and React packages have no dependencies on UI libraries such as Headless UI, Radix, Reka UI, or Floating UI, so both behave the same way, and a fix in Vanilla reaches every package at once. The PHP packages require nothing besides Laravel, Inertia, and other Inertia UI packages, and integrations such as Laravel Excel and Spatie Media Library stay optional.