SwitchProps
约 416 字大约 1 分钟
2025-10-13
Karin API Docs / SwitchProps
接口: SwitchProps
定义于: packages/core/src/types/components/switch.ts:6
开关类型
继承
属性
className?
optional
className:string
定义于: packages/core/src/types/components/base.ts:37
每个渲染的组件都包裹了一个div,这里可以自定义这个div的className
继承自
color?
optional
color:"default"
|"success"
|"primary"
|"secondary"
|"warning"
|"danger"
定义于: packages/core/src/types/components/switch.ts:15
颜色
componentClassName?
optional
componentClassName:string
定义于: packages/core/src/types/components/base.ts:39
组件本身的className
继承自
ComponentProps
.componentClassName
componentType
componentType:
"switch"
定义于: packages/core/src/types/components/switch.ts:7
组件类型
重写了
defaultSelected?
optional
defaultSelected:boolean
定义于: packages/core/src/types/components/switch.ts:25
默认选中
description?
optional
description:string
定义于: packages/core/src/types/components/base.ts:35
描述
继承自
disableAnimation?
optional
disableAnimation:boolean
定义于: packages/core/src/types/components/switch.ts:31
是否禁用动画
endContent?
optional
endContent:string
定义于: packages/core/src/types/components/switch.ts:21
切换结束时显示的图标
endText?
optional
endText:string
定义于: packages/core/src/types/components/switch.ts:11
结束文本
isDisabled?
optional
isDisabled:boolean
定义于: packages/core/src/types/components/switch.ts:29
是否禁用
isReadOnly?
optional
isReadOnly:boolean
定义于: packages/core/src/types/components/switch.ts:27
是否只读
isSelected?
optional
isSelected:boolean
定义于: packages/core/src/types/components/switch.ts:23
输入是否可以被用户选择但不能被更改
key
key:
string
定义于: packages/core/src/types/components/base.ts:31
唯一标识符
继承自
label?
optional
label:string
定义于: packages/core/src/types/components/switch.ts:33
标签
size?
optional
size:"sm"
|"md"
|"lg"
定义于: packages/core/src/types/components/switch.ts:13
大小
startContent?
optional
startContent:string
定义于: packages/core/src/types/components/switch.ts:19
切换开始时显示的图标
startText?
optional
startText:string
定义于: packages/core/src/types/components/switch.ts:9
开始文本
thumbIcon?
optional
thumbIcon:string
定义于: packages/core/src/types/components/switch.ts:17
开关图标