UNPKG

@cainiaofe/cn-ui-m

Version:
37 lines (36 loc) 916 B
import type { CSSProperties, EventHandler, InputHTMLAttributes } from 'react'; import type { BasicSizeType } from './basic-size-type'; export interface CnSwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'onChange'> { /** * 自定义内联样式 */ style?: CSSProperties; /** * 按钮大小 可选值: small, medium, large 尺寸 */ size?: BasicSizeType; /** * 初始是否选中 */ defaultChecked?: boolean; /** * 指定当前是否选中,若有值,则为受控模式 */ checked?: boolean; /** * 是否禁用 */ disabled?: boolean; /** * 只读模式 */ readOnly?: boolean; /** * 是否加载态(loading 效果) */ loading?: boolean; /** * 值改变时触发的回调函数 */ onChange?: (value: any, event: EventHandler<any>) => void; }