Skip to content

Toast

吐司通知组件。

导入

tsx
import { toast } from '@xcloud/ui-core'

基础用法

tsx
import { toast } from '@xcloud/ui-core'

function Example() {
  return (
    <button onClick={() => toast('Hello!')}>
      Show Toast
    </button>
  )
}

API

tsx
// 成功提示
toast.success('操作成功!')

// 错误提示
toast.error('出错了')

// 加载提示
toast.loading('处理中...')

基于 MIT 许可发布