← Back to Index
TFlexFMXToast
Temporary notification message that appears at screen edge with automatic dismissal.
Key Properties
Message: string
Toast notification text.
Title: string
Optional toast title/heading.
ToastType: TToastType
Type: ttSuccess, ttInfo, ttWarning, ttError, ttDefault.
Duration: Integer
Display duration in milliseconds (0 = manual dismiss).
Position: TToastPosition
Screen position: tpTopLeft, tpTopCenter, tpTopRight, tpBottomLeft, tpBottomCenter, tpBottomRight.
ShowCloseButton: Boolean
Display close (X) button.
ShowIcon: Boolean
Display type icon (checkmark, info, warning, error).
AnimationType: TToastAnimation
Entry/exit animation: taSlide, taFade, taZoom.
Usage Examples
Simple Success Toast
Toast1.Message := 'Settings saved successfully!';
Toast1.ToastType := ttSuccess;
Toast1.Duration := 3000; // 3 seconds
Toast1.Show;
Error Notification
Toast1.Title := 'Error';
Toast1.Message := 'Failed to connect to server';
Toast1.ToastType := ttError;
Toast1.Duration := 5000;
Toast1.Position := tpTopCenter;
Toast1.Show;
Custom Position
Toast1.Message := 'New message received';
Toast1.ToastType := ttInfo;
Toast1.Position := tpBottomRight;
Toast1.AnimationType := taSlide;
Toast1.Show;
Manual Dismiss
Toast1.Message := 'Processing...';
Toast1.Duration := 0; // No auto-dismiss
Toast1.ShowCloseButton := True;
Toast1.Show;
// Later...
Toast1.Hide;
Methods
Show - Display the toast notification
Hide - Manually dismiss the toast
ShowToast(Message, ToastType, Duration) - Quick show method
Events
OnShow - Toast appears on screen
OnHide - Toast dismissed
OnClick - User clicks toast
Notes
- Multiple toasts can stack vertically
- Non-blocking - doesn't interrupt user workflow
- Automatically adjusts for mobile and desktop layouts
- Use for feedback messages, confirmations, and notifications
- ColorScheme integration for automatic theming
← Back to Index