ToastView

ToastView is toast, used to remind the user without interrupting the operation.

Code demo

Success tips

import { Toast } from 'tuya-panel-kit'
const [successShow, setSuccessShow] = React.useState(false);
<Toast.Success
show={successShow}
text="Successful Text"
onFinish={() => setSuccessShow(false)}
/>

Warning tips

import { Toast } from 'tuya-panel-kit'
const [warningShow, setWarningShow] = React.useState(false);
<Toast.Warning
show={warningShow}
text="Warning Text"
onFinish={() => setWarningShow(false)}
/>

Error tips

import { Toast } from 'tuya-panel-kit'
const [errorShow, setErrorShow] = React.useState(false);
<Toast.Error
show={errorShow}
text="Error Text"
onFinish={() => setErrorShow(false)}
/>

Loading tips

import { Toast } from 'tuya-panel-kit'
const [loadingShow, setLoadingShow] = React.useState(false);
<Toast.Loading show={loadingShow} onFinish={() => setLoadingShow(false)} />

Light prompt

import { Toast } from 'tuya-panel-kit'
const [show, setShow] = React.useState(false);
<Toast show={show} text="I'm toastView!!!" onFinish={() => setShow(false)} />

API

ToastView

ToastView.Success

ToastView.Warning

ToastView.Error

ToastView.Loading

tuya01:08