Repository navigation
ToastKit v1.5.0 adds first-class support for NativePHP Mobile custom SVG icons while preserving the existing icon API and platform override behavior.
Highlights
- Added custom SVG icons through
icon('custom:payment')and NativePHP'sIcon::custom('payment')helper. - Added shared custom icons and fully mixed platform overrides: custom SVGs, SF Symbols, and Material Icons can be combined freely.
- Added custom SVG rendering across standard, dynamic, and native presentations on iOS.
- Added Android support through NativePHP's compiled
VectorDrawableresolver. - Custom icons respect ToastKit's
iconColor()and renderericonSize()settings. - Added PHP and JavaScript validation for NativePHP-compatible lowercase kebab-case icon names.
- Added missing-asset fallback behavior consistent with NativePHP.
- Added regression coverage for platform-only custom overrides and sparse custom-icon updates.
Usage
Place a single-color SVG directly in your application:
resources/icons/payment.svg
Then use it in a toast:
Toast::make('Payment successful')
->icon('custom:payment')
->iconColor('#22C55E')
->show();Custom and system icons can be mixed per platform:
Toast::make('Payment successful')
->icon(
name: 'check',
ios: 'checkmark.circle.fill',
android: 'custom:payment-android',
)
->show();Compatibility
There is no public ToastKit API break, but ToastKit v1.5.0 now requires NativePHP Mobile 4.7 or later. Applications using NativePHP Mobile 4.1 through 4.6 should remain on ToastKit 1.4.x until they upgrade NativePHP.
Custom SVG files are compiled into native assets. Run a full native rebuild after adding or changing an icon; hot reload is not sufficient. Icons must be single-color and their filenames must use lowercase kebab-case without subdirectories.
Validation
- 194 PHP tests passed with 389 assertions.
- 41 JavaScript tests passed.
- Custom SVG icons were manually verified on Android and iOS emulators.
- Shared icons, mixed platform overrides, platform-only overrides, tinting, sizing, sparse updates, and missing-asset fallbacks were verified.
Full changelog: v1.4.0...v1.5.0