Repository navigation
Releases: victorycodedev/toastkit
Release list
v1.4.0
ToastKit v1.4.0 adds a richer foreground-notification experience while preserving existing ToastKit behavior and APIs.
Highlights
- Added dynamic presentation with
presentation('dynamic')and thedynamic()shortcut. - Added expanding and collapsing foreground-pill designs for iOS and Android, including cutout-origin entrance and exit motion.
- Added predefined icon sizing with
iconSize('sm'|'md'|'lg'). - Added smooth content-update crossfades for title and message changes.
- Added whole-toast press handling through the new
ToastPressedevent. - Added optional JSON-serializable
data()payloads for toast presses and action events. - Added
actions()support for one or two actions with optional per-action colors. - Improved Android queued transitions and dynamic-action alignment.
- Improved accessibility, RTL-aware layouts, native renderer behavior, and Android/iOS parity.
Compatibility
There are no breaking changes in this release.
- Standard presentation remains the default.
- The existing
action(string $label, string $id)API remains supported. - The legacy single-action bridge payload remains compatible.
- Whole-toast presses are opt-in and occur only when non-empty data is attached.
- When
action()andactions()are both used, the last method called wins.
Validation
- 190 PHP tests passed with 378 assertions.
- 37 JavaScript tests passed.
- Standard, dynamic, and native presentations were manually verified on Android and iOS emulators.
- Animations, queued transitions, content updates, swipe dismissal, close controls, attached data, toast presses, one/two actions, action colors, and automatic action dismissal were verified.
Full changelog: v1.3.0...v1.4.0
v1.3.0
ToastKit v1.3.0 brings Opacity Support 🎨
ToastKit v1.3.0 adds optional opacity support, giving you more control over the appearance of your toasts.
✨ What's New
You can now make a toast translucent with a single call:
Toast::success('Saved successfully')
->opacity()
->show();Calling opacity() uses a default opacity of 0.8.
Need more control? Pass your own value between 0.0 and 1.0:
Toast::info('Syncing...')
->opacity(0.6)
->show();v1.2.0
ToastKit v1.2.0 🎉
This release adds unique toast identities and platform-selective native appearance.
What's new
- 🔑 Unique toasts with
unique(),updateUnique(), anddismissUnique() - 🍎 Native iOS appearance with Liquid Glass on supported versions
- 🤖 Native Android appearance using Material 3
- 📱 Choose native rendering independently for iOS and Android with
native() - ⚡ Native mode works with updates, presets, queue/stack, actions, loading, and progress
- 🌐 JavaScript API parity
- 🧪 Expanded PHP, JavaScript, Android, and iOS testing
ToastKit's fully customizable renderer remains the default, so this release is backward compatible.
v1.1.0
ToastKit 1.1.0 🎉
ToastKit 1.1.0 brings richer native animations, first-class progress and loading states, reusable toast presets, and a cleaner exception API.
✨ What's New
New Animations
ToastKit now includes four new native animations:
snappoprevealbounce
You can also control the animation direction independently:
Toast::error('Connection failed')
->animation('snap')
->direction('left')
->show();Supported directions are auto, left, right, top, and bottom.
ToastKit also respects reduced-motion platform settings where supported.
Progress Toasts
ToastKit now has first-class support for determinate progress using values from 0 to 100.
$id = Toast::info('Uploading...')
->persistent()
->progress(0)
->show();
Toast::update($id)
->progress(65)
->message('Uploading 65%...')
->show();
Toast::update($id)
->progress(100)
->success()
->message('Upload complete')
->duration(2000)
->show();Progress updates happen in place without replacing the existing toast.
Loading States
For operations where progress is unknown, you can now display a native indeterminate loading indicator.
$id = Toast::info('Connecting...')
->persistent()
->loading()
->show();
Toast::update($id)
->loading(false)
->success()
->message('Connected')
->duration(1500)
->show();Use progress() for determinate progress and loading() for indeterminate operations.
Reusable Toast Presets
You can now define toast styles once and reuse them throughout your application.
Toast::definePreset('payment-success', fn ($toast) => $toast
->success()
->icon('check_circle')
->animation('reveal')
->position('top')
->duration(3000)
);Then use the preset anywhere:
Toast::preset('payment-success')
->message('Payment received')
->show();Every Toast::preset() call creates a fresh toast builder, so state is never shared between toast instances.
Preset configuration can also be overridden for individual screens:
Toast::preset('payment-success')
->message('Payment received')
->position('bottom')
->animation('pop')
->duration(5000)
->show();For larger applications, presets can be organized in a dedicated App\Toasts\ToastPresets class and registered from your application's service provider.
ToastKit Exception Hierarchy
ToastKit now provides a package-specific exception hierarchy with ToastKitException as the base exception.
use Victorycodedev\ToastKit\Exceptions\ToastKitException;
try {
Toast::preset('payment-success')->show();
} catch (ToastKitException $exception) {
report($exception);
}This gives applications a single exception type they can catch for errors intentionally raised by ToastKit, while still allowing more specific exceptions when needed.
Improved Toast Updates
Sparse updates continue to preserve the existing toast configuration while allowing progress and loading states to be changed independently.
Toast::update($id)
->progress(0)
->loading(false)
->show();Only the properties explicitly supplied to update() are changed.
🎬 Available Animations
ToastKit now supports:
fadeslidescalespringsnappoprevealbounce
📱 Compatibility
- PHP 8.3+
- NativePHP Mobile 4.1+
- Android API 29+
- iOS 18+
📦 Upgrade
composer require victorycodedev/toastkit:^1.1Since ToastKit contains native Android and iOS code, rebuild your NativePHP application after upgrading:
php artisan native:run⚠️ Exception Migration Note
ToastKit exceptions now extend ToastKitException instead of PHP's InvalidArgumentException.
If your application previously caught InvalidArgumentException specifically for ToastKit calls, update it to catch:
use Victorycodedev\ToastKit\Exceptions\ToastKitException;Thanks to everyone using ToastKit, sharing feedback, and helping make it better. 🚀
v1.0.2
Android Queue Animation Fix
This release improves queued toast transitions on Android.
Fixed
Fixed a brief flicker when one queued toast dismissed and the next appeared.
Prevented the next toast from entering before the previous toast completed its exit animation.
Prevented Compose from reusing animation state between different toast instances.
Improved queue handoffs for smoother, more consistent enter and exit animations.
v1.0.1
This is a maintenance release focused on native reliability, consistent animations, and release stability.
Fixed
Fixed Android toasts not appearing when optional payload values were null.
Fixed Android toast host attachment when NativePHP initializes after the activity has resumed.
Improved
Added consistent enter and exit behavior for fade, slide, scale, and spring animations.
Improved Android handling of NativePHP bridge payloads.
Simplified the icon API to accept only strings or null for shared, iOS, and Android icon names.
v1.0.0
ToastKit v1.0.0
The first stable release of ToastKit - rich, customizable native toast notifications for NativePHP Mobile on iOS and Android.
ToastKit provides a fluent PHP and JavaScript API for displaying and controlling native toasts, with support for:
Success, error, warning, info, and neutral variants
Custom icons and colors
Top, center, and bottom positioning
Custom typography and fonts
Fade, slide, scale, and spring animations
Timed and persistent toasts
Swipe-to-dismiss and close controls
Toast actions and events
Updating an existing toast by ID
Programmatic dismiss() and dismissAll()
Queue and stack strategies with overflow handling
NativePHP typed icons and enum-friendly APIs
PHP and JavaScript APIs
Native rendering with Jetpack Compose on Android and SwiftUI on iOS