Introduction
⚙️ – Core
⚛️ – Atoms-Molecules
AvatarBadgeButtonCheckBoxFieldCircleDividerDownloadCardIconInputFieldInputFieldButtonLinkListItemOneTimeCodeInputPhotoAvatarRadioGroupFieldRatingSelectFieldSimpleAvatarSpacerSwitchFieldTextToastPropertiesHook ExampleVariantsVariations without EnfasisWith custom elements❌ Icon (Deprecated)❌ Roboto (Deprecated)❌ WorkSans (Deprecated)
🧬 – Organisms
Toast
A DpToast component, supports Android, IOS, Web, Windows
Properties
id
string | undefined
Autogenerated id
onClose
(() => void) | undefined
Trigger when toast is closed
onAction
(() => void) | undefined
On press action button
onPress
((id?: string | undefined) => () => void) | undefined
On press toast
actionText
string | undefined
Text of the action button
message
string | Element
required
Message on toast
placement
"top" | "bottom" | undefined
bottom
Toast position
icon
"action-add-phone" | "action-add-visit" | "action-alarm-clock" | "action-alarm" | "action-back" | "action-bin" | "action-bookmark" | "action-calendar-block" | "action-calendar-filled" | ... 254 more ... | undefined
Icon to show on toast
type
"gray" | "primary" | "info" | "success" | "danger" | "warning" | "calm" | undefined
info
🎨 Toast variant
emphasis
"high" | "low" | undefined
high
🎨 Color variant emphasis
duration
number | undefined
3000
Visible duration of toast
style
ViewStyle | undefined
Custom style for the toast container
toastHandler
(() => void) | undefined
Toast setter to be able to have default behavior
Hook Example
You can use hooks to call toasts everywhere, to do so, wrap DpToastContextProvider
to your root component (index.js or App.js)