SusButton

主操作按钮 — 变体、颜色、尺寸、图标、加载状态。
包
SusKit · 原子(商业)
SusKit · Atoms
属性
| 名称 | 类型 | 默认值 | |
|---|---|---|---|
Text | Prop<string> | "" | |
Variant | Prop<string> | "elevated" | |
Color | Prop<string> | "primary" | |
Size | Prop<string> | "default" | |
Density | Prop<string> | "default" | |
PrependIcon | Prop<string> | "" | |
AppendIcon | Prop<string> | "" | |
Icon | Prop<string> | "" | |
Disabled | Prop<bool> | false | |
Loading | Prop<bool> | false | |
Readonly | Prop<bool> | false | |
Active | Prop<bool> | false | |
Block | Prop<bool> | false | |
Stacked | Prop<bool> | false | |
Rounded | Prop<string> | "md" | |
Border | Prop<string> | "" | |
Spaced | Prop<string> | "" |
插槽
| 名称 |
|---|
loader |
事件
| 名称 | 字段 | 载荷 |
|---|---|---|
Click | OnClick | — |
样式钩子
USS 类契约 — 无需改 C# 即可覆盖外观。状态通过这些类切换:
keyboard-focussus-buttonsus-button__contentsus-button__icon-wrapsus-button__icon-wrap--appendsus-button__icon-wrap--prependsus-button__labelsus-button__loadersus-button--activesus-button--blocksus-button--border-lgsus-button--border-mdsus-button--border-smsus-button--border-xlsus-button--border-xssus-button--color-dangersus-button--color-infosus-button--color-primarysus-button--color-secondarysus-button--color-successsus-button--color-warningsus-button--density-comfortablesus-button--density-compactsus-button--disabledsus-button--elevatedsus-button--flatsus-button--icon-onlysus-button--loadingsus-button--outlinedsus-button--plainsus-button--readonlysus-button--rounded-0sus-button--rounded-circlesus-button--rounded-lgsus-button--rounded-mdsus-button--rounded-pillsus-button--rounded-smsus-button--rounded-xlsus-button--rounded-xssus-button--size-defaultsus-button--size-lgsus-button--size-smsus-button--size-xlsus-button--size-xssus-button--spaced-bothsus-button--spaced-endsus-button--spaced-startsus-button--stackedsus-button--textsus-button--tonal
用法
xml
<template>
<sus:SusButton Text="Save"
Variant="elevated"
Color="primary"
PrependIcon="floppy-disk"
@click="OnSave" />
</template>
<script>
void OnSave() { /* … */ }
</script>csharp
var btn = new SusButton();
btn.Text.Value = "Save";
btn.OnClick += () => { /* … */ };变体
elevated · flat · tonal · outlined · text · plain
颜色
primary · secondary · success · danger · warning · info