---
title: API
order: 5
docGenIncludes:
  - src/components/YwFormDialog/index.tsx
---

```ts
export interface YwFormDialogProps {
  /** 自定义触发元素 */
  children?: React.ReactNode;
  /** 组件受控 */
  visible?: boolean;
  /** 弹窗名称 */
  title: string;
  /** 弹窗尺寸 */
  size?: 's' | 'm' | 'l' | 'full';
  /** 按钮文字 */
  btnText: string;
  /** 按钮类型 */
  btnType?: 'default' | 'link' | 'primary' | 'dash';
  /** 按钮禁用 */
  btnDisabled?: boolean | Function;
  /** 表单项 */
  items: YwJsonFormProps['items'];
  /** 表单是否禁用 */
  disabled?: boolean;
  /** 表单是否可编辑 */
  editable?: boolean;
  /** 表单布局 */
  layoutProps?: YwJsonFormProps['layoutProps'];
  /** 表单 初始值*/
  initialValues?: object;
  /** 取消回调*/
  onCancel?: () => Promise;
  /** 确认回调*/
  onConfirm?: () => Promise;
  /** 弹窗打开回调*/
  onOpen?: () => Promise<initialValues>;
}

```