UNPKG

@nutui/nutui-react-taro

Version:

京东风格的轻量级移动端 React 组件库,支持一套代码生成 H5 和小程序

36 lines (35 loc) 788 B
import { default as React, FunctionComponent } from 'react'; import { BasicComponent } from '../../utils/typings'; export interface SwitchProps extends BasicComponent { /** * 开关状态,受控 * @default false */ checked: boolean /** * 开关状态,非受控 * @default false */ defaultChecked: boolean /** * 禁用状态 * @default false */ disabled: boolean /** * 打开时文字描述 * @default - */ activeText: string /** * 关闭时文字描述 * @default - */ inactiveText: string /** * 切换开关时触发 * @default - */ onChange: (val: boolean, event: React.MouseEvent) => void } export declare const Switch: FunctionComponent<Partial<SwitchProps>>;