ToastConfig
Defined in: ui/Toast.ts:48
Configuration interface for creating a Toast notification.
Example
Section titled “Example”// Basic toast with default settingsconst config: ToastConfig = { message: "Operation successful!", type: "success"};
// Custom styled toast with shadow and close buttonconst config: ToastConfig = { message: "Custom notification", backgroundColor: 0x9b59b6, backgroundAlpha: 1, cornerRadius: 8, shadow: { color: 0x000000, alpha: 0.2, offset: { x: 4, y: 4 } }, closeButton: { show: true, position: 'top right' }};Properties
Section titled “Properties”autoClose?
Section titled “autoClose?”
optionalautoClose:boolean
Defined in: ui/Toast.ts:72
Whether the toast should automatically close after duration
backgroundAlpha?
Section titled “backgroundAlpha?”
optionalbackgroundAlpha:number
Defined in: ui/Toast.ts:66
Background opacity (0-1)
backgroundColor?
Section titled “backgroundColor?”
optionalbackgroundColor:number
Defined in: ui/Toast.ts:64
Background color in hex format
class?
Section titled “class?”
optionalclass: typeofToast
Defined in: ui/Toast.ts:50
Optional custom Toast class to use instead of the default
closeButton?
Section titled “closeButton?”
optionalcloseButton:object
Defined in: ui/Toast.ts:91
Close button configuration
class?
Section titled “class?”
optionalclass: typeofButton
Custom button class to use
offset?
Section titled “offset?”
optionaloffset:number
Offset from the edges
position?
Section titled “position?”
optionalposition:CloseButtonPosition
Position of the close button
optionalshow:boolean
Whether to show the close button
optionalsize:number
Size of the close button
colorBarWidth?
Section titled “colorBarWidth?”
optionalcolorBarWidth:number
Defined in: ui/Toast.ts:80
Width of the colored type indicator bar
cornerRadius?
Section titled “cornerRadius?”
optionalcornerRadius:number
Defined in: ui/Toast.ts:68
Corner radius for rounded corners
duration?
Section titled “duration?”
optionalduration:number
Defined in: ui/Toast.ts:56
Duration in milliseconds before auto-closing (if autoClose is true)
height?
Section titled “height?”
optionalheight:number
Defined in: ui/Toast.ts:62
Height of the toast in pixels
message
Section titled “message”message:
string
Defined in: ui/Toast.ts:52
The message to display in the toast
padding?
Section titled “padding?”
optionalpadding:number
Defined in: ui/Toast.ts:70
Padding around the content
shadow?
Section titled “shadow?”
optionalshadow:object
Defined in: ui/Toast.ts:82
Shadow configuration for depth effect
alpha?
Section titled “alpha?”
optionalalpha:number
Shadow opacity (0-1)
color?
Section titled “color?”
optionalcolor:number
Shadow color in hex format
offset?
Section titled “offset?”
optionaloffset:object
Shadow offset from the toast
offset.x
Section titled “offset.x”x:
number
offset.y
Section titled “offset.y”y:
number
style?
Section titled “style?”
optionalstyle:Partial<Omit<TextStyleOptions,"fontFamily"> &object>
Defined in: ui/Toast.ts:58
Custom text style options
textAlign?
Section titled “textAlign?”
optionaltextAlign:"center"|"left"|"right"
Defined in: ui/Toast.ts:76
Horizontal text alignment
textColors?
Section titled “textColors?”
optionaltextColors:Record<ToastType,number>
Defined in: ui/Toast.ts:74
Custom colors for each toast type’s indicator
optionaltype:ToastType
Defined in: ui/Toast.ts:54
Type of toast, determines the color indicator
verticalAlign?
Section titled “verticalAlign?”
optionalverticalAlign:"bottom"|"middle"|"top"
Defined in: ui/Toast.ts:78
Vertical text alignment
width?
Section titled “width?”
optionalwidth:number
Defined in: ui/Toast.ts:60
Width of the toast in pixels