@ray-js/components
Version:
Ray basic components
48 lines (47 loc) • 1.17 kB
TypeScript
import { GenericEvent } from '@ray-js/adapter';
import { BaseProps } from '../types';
export interface SwitchProps extends BaseProps {
/**
* @description.en onChange
* @description.zh checked 改变时触发 change 事件,event.detail={ value}
* @default undefined
*/
onChange?: (event: GenericEvent<{
value: any;
}>) => void;
/**
* @description.en checked
* @description.zh 当前是否选中
* @default false
*/
checked?: boolean;
/**
* @description.en disabled
* @description.zh 是否禁用
* @default false
*/
disabled?: boolean;
/**
* @description.en color
* @description.zh Switch 的颜色,同 css 的 color
* @default #007AFF
*/
color?: string;
/**
* @description.en type
* @description.zh 可选值 switch checkbox
* @default switch
*/
type?: 'switch' | 'checkbox';
/**
* @description.en style
* @description.zh 风格
* @default undefined
*/
style?: React.CSSProperties;
}
export declare const defaultSwitchProps: {
type: string;
color: string;
disabled: boolean;
};