---
name: Toast 提示
route: /toast
menu: 交互组件
---

import { Playground } from 'docz';
import Toast from './index';
import Button from '../button/index';

## 演示

### 简单示例

<Playground>
  <Button onClick={() => Toast.info('Info')}>Info</Button>{' '}
  <Button onClick={() => Toast.success('Success')}>Success</Button>{' '}
  <Button onClick={() => Toast.warning('Warning')}>Warning</Button>{' '}
  <Button onClick={() => Toast.error('Error')}>Error</Button>
</Playground>

## API

### Toast Fns

`Toast.show`

```jsx
(type: 'info' | 'success' | 'warning' | 'error', content: React.ReactNode, duration?: number) => void
```

`Toast.info`, `Toast.success`, `Toast.warning`, `Toast.error`

```jsx
(content: React.ReactNode, duration?: number) => void
```
