Demos
How to import
<script setup lang="ts">
import { Button, ButtonGroup, SplitButtonGroup } from '@fibrous/semi-ui-vue';
</script>
Button Type
Buttons support the following types:
- Primary button ("primary", default)
- Secondary button ("secondary")
- Tertiary button ("tertiary")
- Warning button ("warning")
- Danger button ("danger")
Code
<script setup lang="ts">
import { Button } from '@fibrous/semi-ui-vue';
</script>
<template>
<div class="btn-margin-right">
<Button>主要按钮</Button>
<Button type="secondary">次要按钮</Button>
<Button type="tertiary">第三按钮</Button>
<Button type="warning">警告按钮</Button>
<Button type="danger">危险按钮</Button>
</div>
</template>About the Font Color
CSS Variables are used with the button:
var(--semi-color-primary): mainvar(--semi-color-secondary): secondaryvar(--semi-color-tertiary): thirdvar(--semi-color-warning): warningvar(--semi-color-danger): danger
You can define your elements directly using these theme colors.
Code
<script setup lang="ts">
const types = [
['primary', '主要'],
['secondary', '次要'],
['tertiary', '第三'],
['warning', '警告'],
['danger', '危险'],
];
</script>
<template>
<article>
<strong v-for="[type, label] in types" :key="type" :style="{ color: `var(--semi-color-${type})`, marginRight: '10px' }">
{{ label }}
</strong>
</article>
</template>Button Theme
The themes currently available are:
light: light backgroundsolid: dark backgroundborderless: no backgroundoutline: border mode
The default theme is light
Light Background
Code
<script setup lang="ts">
import { Button } from '@fibrous/semi-ui-vue';
</script>
<template>
<Button :style="{ marginRight: '8px' }" theme="light" type="primary">浅色主要</Button>
<Button :style="{ marginRight: '8px' }" theme="light" type="secondary">浅色次要</Button>
<Button :style="{ marginRight: '8px' }" theme="light" type="tertiary">浅色第三</Button>
<Button :style="{ marginRight: '8px' }" theme="light" type="warning">浅色警告</Button>
<Button :style="{ marginRight: '8px' }" theme="light" type="danger">浅色危险</Button>
</template>Dark Background
Code
<script setup lang="ts">
import { Button } from '@fibrous/semi-ui-vue';
</script>
<template>
<Button :style="{ marginRight: '8px' }" theme="solid" type="primary">深色主要</Button>
<Button :style="{ marginRight: '8px' }" theme="solid" type="secondary">深色次要</Button>
<Button :style="{ marginRight: '8px' }" theme="solid" type="tertiary">深色第三</Button>
<Button :style="{ marginRight: '8px' }" theme="solid" type="warning">深色警告</Button>
<Button :style="{ marginRight: '8px' }" theme="solid" type="danger">深色危险</Button>
</template>No Background
Code
<script setup lang="ts">
import { Button } from '@fibrous/semi-ui-vue';
</script>
<template>
<Button :style="{ marginRight: '8px' }" theme="borderless" type="primary">主要</Button>
<Button :style="{ marginRight: '8px' }" theme="borderless" type="secondary">次要</Button>
<Button :style="{ marginRight: '8px' }" theme="borderless" type="tertiary">第三</Button>
<Button :style="{ marginRight: '8px' }" theme="borderless" type="warning">警告</Button>
<Button :style="{ marginRight: '8px' }" theme="borderless" type="danger">危险</Button>
</template>Border Mode
Code
<script setup lang="ts">
import { Button } from '@fibrous/semi-ui-vue';
</script>
<template>
<Button :style="{ marginRight: '8px' }" theme="outline" type="primary">主要</Button>
<Button :style="{ marginRight: '8px' }" theme="outline" type="secondary">次要</Button>
<Button :style="{ marginRight: '8px' }" theme="outline" type="tertiary">第三</Button>
<Button :style="{ marginRight: '8px' }" theme="outline" type="warning">警告</Button>
<Button :style="{ marginRight: '8px' }" theme="outline" type="danger">危险</Button>
</template>Size
Three sizes are defined by default:
- Big: "Large"
- Default: "default."
- Small: "Small"
Code
<script setup lang="ts">
import { Button } from '@fibrous/semi-ui-vue';
</script>
<template>
<div>
<Button size="large" :style="{ marginRight: '8px' }">大尺寸</Button>
<Button size="default" :style="{ marginRight: '8px' }">默认尺寸</Button>
<Button size="small">小尺寸</Button>
</div>
</template>Block Button
The block button has a predefined width, and its width is independent of the width of the contents of the button.
Code
<script setup lang="ts">
import { Button } from '@fibrous/semi-ui-vue';
</script>
<template>
<div>
<Button block>块级按钮</Button>
</div>
</template>Icon Button
An icon that defines a button.
Put the icon in the #icon slot; iconPosition decides where it goes.
禁用状态:
复合类型:
更改主题:
更改图标位置:
Code
<script setup lang="ts">
import { IconCamera, IconChevronDown, IconSidebar } from '@fibrous/semi-icons-vue';
import { Button } from '@fibrous/semi-ui-vue';
</script>
<template>
<div>
<strong>默认状态:</strong>
<Button aria-label="截屏">
<template #icon>
<IconCamera />
</template>
</Button>
<br />
<br />
<strong>禁用状态:</strong>
<Button aria-label="截屏" disabled>
<template #icon>
<IconCamera />
</template>
</Button>
<br />
<br />
<strong>复合类型:</strong>
<span class="btn-margin-right">
<Button aria-label="截屏" type="primary">
<template #icon>
<IconCamera />
</template>
</Button>
<Button aria-label="截屏" type="secondary">
<template #icon>
<IconCamera />
</template>
</Button>
<Button aria-label="截屏" type="warning">
<template #icon>
<IconCamera />
</template>
</Button>
<Button aria-label="截屏" type="danger">
<template #icon>
<IconCamera />
</template>
</Button>
</span>
<br />
<br />
<strong>更改主题:</strong>
<Button aria-label="截屏" :style="{ marginRight: '10px' }" theme="solid">
<template #icon>
<IconCamera />
</template>
</Button>
<Button aria-label="截屏" theme="light">
<template #icon>
<IconCamera />
</template>
</Button>
<br />
<br />
<strong>更改图标位置:</strong>
<Button :style="{ marginRight: '10px' }" theme="solid">
<template #icon>
<IconSidebar />
</template>
收起
</Button>
<Button iconPosition="right" theme="solid">
<template #icon>
<IconChevronDown />
</template>
展开选项
</Button>
<br />
<br />
</div>
</template>Link Button
We recommend using Typography to achieve link text button. Refer to Typography for more information.
Code
<script setup lang="ts">
import { IconLink } from '@fibrous/semi-icons-vue';
import { Typography } from '@fibrous/semi-ui-vue';
const { Text } = Typography;
</script>
<template>
<div>
<Text :link="{ href: 'https://semi.design/' }">链接文本</Text>
<br />
<br />
<Text :link="{ href: 'https://semi.design/' }">打开网站</Text>
<br />
<br />
<Text link underline>
带下划线的网页链接
<template #icon>
<IconLink />
</template>
</Text>
</div>
</template>Prohibited Status
Code
<script setup lang="ts">
import { Button } from '@fibrous/semi-ui-vue';
</script>
<template>
<div>
<Button disabled>禁用</Button>
<Button disabled theme="borderless">无背景禁用</Button>
<Button disabled theme="light">浅色禁用</Button>
<Button disabled theme="borderless" type="primary">无背景主要禁用</Button>
<Button disabled theme="solid" type="warning">深色警告禁用</Button>
</div>
</template>Loading State
The button supports the Loading state, by setting the loading parameter value to true, note: the disabled state takes precedence over the loading state.
Code
<script setup lang="ts">
import { ref } from 'vue';
import { IconDelete } from '@fibrous/semi-icons-vue';
import { Button } from '@fibrous/semi-ui-vue';
const saveLoading = ref(false);
const delLoading = ref(true);
const repLoading = ref(true);
const reset = (status: boolean) => {
saveLoading.value = status;
delLoading.value = status;
repLoading.value = status;
};
</script>
<template>
<div>
<div>
<div class="btn-margin-right" :style="{ display: 'inline-flex', alignItems: 'center', paddingBottom: '14px' }">
<Button @click="reset(false)">关闭加载态</Button>
<Button @click="reset(true)">开启加载态</Button>
</div>
</div>
<hr />
<Button :loading="saveLoading" :style="{ marginRight: '14px' }" @click="saveLoading = true">保存</Button>
<Button :loading="delLoading" :style="{ marginRight: '14px' }" type="danger" @click="delLoading = true">
<template #icon>
<IconDelete />
</template>
删除
</Button>
<div :style="{ width: '200px', display: 'inline-block' }">
<Button block :loading="repLoading" theme="solid" type="warning" @click="repLoading = true">撤销</Button>
</div>
</div>
</template>AI style - Colorful buttons
Set colorful to get colorful buttons. Colorful buttons support all theme, and type only supports primary and tertiary.
Code
<script setup lang="ts">
import { IconAIFilledLevel1, IconAIFilledLevel2, IconAIFilledLevel3 } from '@fibrous/semi-icons-vue';
import { Button } from '@fibrous/semi-ui-vue';
const contents = ['Colorful', undefined];
const rows = [
{ theme: 'solid', primaryIcon: IconAIFilledLevel1, tertiaryIcon: IconAIFilledLevel3 },
{ theme: 'light', primaryIcon: IconAIFilledLevel3, tertiaryIcon: IconAIFilledLevel2 },
{ theme: 'outline', primaryIcon: IconAIFilledLevel1, tertiaryIcon: IconAIFilledLevel2 },
{ theme: 'borderless', primaryIcon: IconAIFilledLevel3, tertiaryIcon: IconAIFilledLevel2 },
] as const;
</script>
<!-- The text goes in an explicit #default: after a sibling #icon template, a bare {{ content }} gets a leading space,
which would count as text and break the icon-only layout. -->
<template>
<div v-for="content in contents" :key="content ?? 'icon-only'" :style="{ display: 'flex', rowGap: '16px', marginTop: '20px', marginLeft: '10px', flexDirection: 'column' }">
<div v-for="row in rows" :key="row.theme" :style="{ display: 'flex', columnGap: '16px' }">
<Button :aria-label="content ? undefined : 'AI'" colorful :theme="row.theme" type="primary">
<template #icon>
<component :is="row.primaryIcon" />
</template>
<template #default>{{ content }}</template>
</Button>
<Button :aria-label="content ? undefined : 'AI'" colorful loading :theme="row.theme" type="primary">
{{ content }}
</Button>
<Button :aria-label="content ? undefined : 'AI'" colorful disabled :theme="row.theme" type="primary">
<template #icon>
<component :is="row.primaryIcon" />
</template>
<template #default>{{ content }}</template>
</Button>
<Button :aria-label="content ? undefined : 'AI'" colorful :theme="row.theme" type="tertiary">
<template #icon>
<component :is="row.tertiaryIcon" />
</template>
<template #default>{{ content }}</template>
</Button>
<Button :aria-label="content ? undefined : 'AI'" colorful loading :theme="row.theme" type="tertiary">
{{ content }}
</Button>
<Button :aria-label="content ? undefined : 'AI'" colorful disabled :theme="row.theme" type="tertiary">
<template #icon>
<component :is="row.tertiaryIcon" />
</template>
<template #default>{{ content }}</template>
</Button>
</div>
</div>
</template>Button Combination
You can put multiple buttons in a ButtonGroup container and set size, disabled, type, theme and colorful on it to give the buttons a shared size, disabled state, type, theme and colorful style. These props are only defaults: a value set on a button itself wins. Other props such as data-*, id, aria-* and event handlers go to the group's root element (role="group").
Combined Dimensions
Code
<script setup lang="ts">
import { Button, ButtonGroup } from '@fibrous/semi-ui-vue';
const sizes = ['large', 'default', 'small'] as const;
</script>
<template>
<div :style="{ display: 'flex' }">
<div v-for="size in sizes" :key="size" :style="{ marginRight: '10px' }">
<ButtonGroup aria-label="操作按钮组" :size="size">
<Button>拷贝</Button>
<Button>查询</Button>
<Button>剪切</Button>
</ButtonGroup>
</div>
</div>
</template>Combined Disabled
Code
<script setup lang="ts">
import { Button, ButtonGroup } from '@fibrous/semi-ui-vue';
</script>
<template>
<div :style="{ display: 'flex' }">
<div :style="{ marginRight: '10px' }">
<ButtonGroup disabled>
<Button>拷贝</Button>
<Button>查询</Button>
<Button>剪切</Button>
</ButtonGroup>
</div>
</div>
</template>Combined Type
Code
<script setup lang="ts">
import { Button, ButtonGroup } from '@fibrous/semi-ui-vue';
const types = ['primary', 'secondary', 'tertiary', 'warning', 'danger'] as const;
</script>
<template>
<div :style="{ display: 'flex' }">
<div v-for="type in types" :key="type" :style="{ marginRight: '10px' }">
<ButtonGroup aria-label="操作按钮组" :type="type">
<Button>拷贝</Button>
<Button>查询</Button>
<Button>剪切</Button>
</ButtonGroup>
</div>
</div>
</template>Split Button Group
In the scene where Button and Dropdown are combined, split buttons can be used. The split buttons add the space between the buttons and change the rounded corners of the buttons.
Basic Usage
Code
<script setup lang="ts">
import { reactive } from 'vue';
import { IconTreeTriangleDown } from '@fibrous/semi-icons-vue';
import { Button, Dropdown, SplitButtonGroup, type DropDownMenuItem } from '@fibrous/semi-ui-vue';
const menu: DropDownMenuItem[] = [
{ node: 'item', name: '编辑项目', onClick: () => console.log('编辑项目点击') },
{ node: 'item', name: '重置项目' },
{ node: 'divider' },
{ node: 'item', name: '复制项目' },
{ node: 'item', name: '从项目创建模版' },
{ node: 'divider' },
{ node: 'item', name: '删除项目', type: 'danger' },
];
const btnVisible = reactive<Record<number, boolean>>({ 1: false, 2: false, 3: false });
</script>
<template>
<div>
<SplitButtonGroup aria-label="项目操作按钮组" :style="{ marginRight: '10px' }">
<Button theme="solid" type="primary">分裂按钮</Button>
<Dropdown :menu="menu" position="bottomRight" trigger="click" @visibleChange="(v) => (btnVisible[1] = v)">
<Button aria-label="更多操作" :style="btnVisible[1] ? { background: 'var(--semi-color-primary-hover)', padding: '8px 4px' } : { padding: '8px 4px' }" theme="solid" type="primary">
<template #icon>
<IconTreeTriangleDown />
</template>
</Button>
</Dropdown>
</SplitButtonGroup>
<SplitButtonGroup aria-label="项目操作按钮组" :style="{ marginRight: '10px' }">
<Button theme="light" type="primary">分裂按钮</Button>
<Dropdown :menu="menu" position="bottomRight" trigger="click" @visibleChange="(v) => (btnVisible[2] = v)">
<Button aria-label="更多操作" :style="btnVisible[2] ? { background: 'var(--semi-color-fill-1)', padding: '8px 4px' } : { padding: '8px 4px' }" theme="light" type="primary">
<template #icon>
<IconTreeTriangleDown />
</template>
</Button>
</Dropdown>
</SplitButtonGroup>
<SplitButtonGroup aria-label="项目操作按钮组">
<Button :style="btnVisible[3] ? { background: 'var(--semi-color-fill-0)' } : {}" theme="borderless" type="primary"> 分裂按钮 </Button>
<Dropdown :menu="menu" position="bottomRight" trigger="click" @visibleChange="(v) => (btnVisible[3] = v)">
<Button aria-label="更多操作" :style="btnVisible[3] ? { background: 'var(--semi-color-fill-1)', padding: '8px 4px' } : { padding: '8px 4px' }" theme="borderless" type="primary">
<template #icon>
<IconTreeTriangleDown />
</template>
</Button>
</Dropdown>
</SplitButtonGroup>
</div>
</template>API Reference
Button
Props
| Property | Description | Type | Default |
|---|---|---|---|
| block | Renders the button as a block-level button. | boolean | semiDefault("Button", "block", false) |
| colorful | Colorful button, supported for the primary and tertiary types only. Falls back to the ButtonGroup it is in, and finally to false. | boolean | undefined |
| contentClassName | Class name of the content area. | string | semiGlobalDefault("Button", "contentClassName") |
| disabled | Disabled state, which takes precedence over loading. Falls back to the ButtonGroup it is in, and finally to false. | boolean | undefined |
| htmlType | Native type of the button: button, reset or submit. | HtmlType | semiDefault("Button", "htmlType", "button") |
| iconPosition | Icon position: left or right. | "left" | "right" | semiDefault("Button", "iconPosition", strings.DEFAULT_ICON_POSITION) |
| loading | Loading state. A loading button stays focusable, its click is ignored, and a submit button does not submit its form. | boolean | semiDefault("Button", "loading", false) |
| noHorizontalPadding | Removes horizontal padding: true, left, right or an array of both. Applies only to a button that shows an icon or the loading spinner. | boolean | HorizontalPaddingType | HorizontalPaddingType[] | semiDefault("Button", "noHorizontalPadding", false) |
| size | Button size: large, default or small. Falls back to the ButtonGroup it is in, and finally to default. | Size | undefined |
| theme | Button theme: solid, borderless, light or outline. Falls back to the ButtonGroup it is in, and finally to light. | Theme | undefined |
| type | Button type: primary, secondary, tertiary, warning or danger. Falls back to the ButtonGroup it is in, and finally to primary. | Type | undefined |
Events
| Event | Description | Callback parameters |
|---|---|---|
| None |
Slots
| Slot | Description | Scope parameters |
|---|---|---|
| default | Button text. | any |
| icon | Button icon, placed by iconPosition. | any |
Exposes
| Name | Description | Type |
|---|---|---|
| None |
class, style and native attributes (such as id and aria-*) land on the native <button> through attrs. Native events such as click, mousedown, mouseenter and mouseleave are listened to with @click and so on, and receive the native MouseEvent. click does not fire while loading.
ButtonGroup
Props
| Property | Description | Type | Default |
|---|---|---|---|
| colorful | Colorful style, used as the default of the buttons in the group. | boolean | semiGlobalDefault("ButtonGroup", "colorful") |
| disabled | Disabled state, used as the default of the buttons in the group. | boolean | semiGlobalDefault("ButtonGroup", "disabled") |
| size | Button size, used as the default of the buttons in the group. | Size | semiGlobalDefault("ButtonGroup", "size") |
| theme | Button theme, used as the default of the buttons in the group. | Theme | semiGlobalDefault("ButtonGroup", "theme") |
| type | Button type, used as the default of the buttons in the group. | Type | semiGlobalDefault("ButtonGroup", "type") |
Events
| Event | Description | Callback parameters |
|---|---|---|
| None |
Slots
| Slot | Description | Scope parameters |
|---|---|---|
| default | Buttons in the group. | any |
Exposes
| Name | Description | Type |
|---|---|---|
| None |
class, style and native attributes (such as data-* and aria-*) land on the group's root element (role="group") through attrs.
SplitButtonGroup
Props
| Property | Description | Type | Default |
|---|---|---|---|
| None |
Events
| Event | Description | Callback parameters |
|---|---|---|
| None |
Slots
| Slot | Description | Scope parameters |
|---|---|---|
| default | A Button followed by a Dropdown that wraps a Button. | any |
Exposes
| Name | Description | Type |
|---|---|---|
| None |
class, style and native attributes (such as aria-*) land on the split button group's root element (role="group") through attrs.
Accessibility
ARIA
aria-labelis used to indicate the function of the button. For icon buttons, we recommend using this attributearia-disabledis true when the button is disabled or loading, indicating that the button cannot be operated
Keyboard and Focus
Button's focus management is consistent with nativebutton, keyboard users can useTabandShift + Tabto switch focus- The trigger of
Buttonis the same as the nativebutton, when thebuttonis focused, it can be activated byEnterorSpacekey - The buttons in the
ButtonGroupare managed in the same way as the focus of a singlebutton, and can be switched byTabandShift + Tab
Content Guidelines
- Buttons need to be clear and predictable, users should be able to predict what will happen when they click the button
- Buttons should always start with a strong verb that encourages action
- To give the user enough context, use {verb}+{noun} content formulas on buttons; in addition to common actions like "Done", "Close", "Cancel" or "OK"
| ✅ Recommended usage | ❌ Deprecated usage |
|---|---|
No permission to view this page | No permission to view this page |
- When the button is combined with other components, the button can only display {verb}, such as "Add", "Create", if the other components (such as Modal and Sidesheet) already provide enough context for the information
| ✅ Recommended usage | ❌ Deprecated usage |
|---|---|
![]() | ![]() |
- Always write in Sentence case
| ✅ Recommended usage | ❌ Deprecated usage |
|---|---|
| Create project | Create Create a project |
| Edit profile | Edit |
Design Tokens
| Sass variable | Value | Usage |
|---|---|---|
| $transition_duration-button_primary-bg | var(--semi-transition_duration-none) | 主要按钮-背景色-动画持续时间 |
| $transition_function-button_primary-bg | var(--semi-transition_function-easeIn) | 主要按钮-背景色-过渡曲线 |
| $transition_delay-button_primary-bg | var(--semi-transition_delay-none) | 主要按钮-背景色-延迟时间 |
| $transition_duration-button_secondary-bg | var(--semi-transition_duration-none) | 次要按钮-背景色-动画持续时间 |
| $transition_function-button_secondary-bg | var(--semi-transition_function-easeIn) | 次要按钮-背景色-过渡曲线 |
| $transition_delay-button_secondary-bg | var(--semi-transition_delay-none) | 次要按钮-背景色-延迟时间 |
| $transition_duration-button_tertiary-bg | var(--semi-transition_duration-none) | 三级按钮-背景色-动画持续时间 |
| $transition_function-button_tertiary-bg | var(--semi-transition_function-easeIn) | 三级按钮-背景色-过渡曲线 |
| $transition_delay-button_tertiary-bg | var(--semi-transition_delay-none) | 三级按钮-背景色-延迟时间 |
| $transition_duration-button_light-bg | var(--semi-transition_duration-none) | 浅色按钮-背景色-动画持续时间 |
| $transition_function-button_light-bg | var(--semi-transition_function-easeIn) | 浅色按钮-背景色-过渡曲线 |
| $transition_delay-button_light-bg | var(--semi-transition_delay-none) | 浅色按钮-背景色-延迟时间 |
| $transition_duration-button_warning-bg | var(--semi-transition_duration-none) | 警告按钮-背景色-动画持续时间 |
| $transition_function-button_warning-bg | var(--semi-transition_function-easeIn) | 警告按钮-背景色-过渡曲线 |
| $transition_delay-button_warning-bg | var(--semi-transition_delay-none) | 警告按钮-背景色-延迟时间 |
| $transition_duration-button_danger-bg | var(--semi-transition_duration-none) | 危险按钮-背景色-动画持续时间 |
| $transition_function-button_danger-bg | var(--semi-transition_function-easeIn) | 危险按钮-背景色-过渡曲线 |
| $transition_delay-button_danger-bg | var(--semi-transition_delay-none) | 危险按钮-背景色-延迟时间 |
| $transition_duration-button_borderless-bg | var(--semi-transition_duration-none) | 无边框按钮-背景色-动画持续时间 |
| $transition_function-button_borderless-bg | var(--semi-transition_function-easeIn) | 无边框按钮-背景色-过渡曲线 |
| $transition_delay-button_borderless-bg | var(--semi-transition_delay-none) | 无边框按钮-背景色-延迟时间 |
| $transition_duration-button_primary-border | var(--semi-transition_duration-none) | 主要按钮-边框-动画持续时间 |
| $transition_function-button_primary-border | var(--semi-transition_function-easeIn) | 主要按钮-边框-过渡曲线 |
| $transition_delay-button_primary-border | var(--semi-transition_delay-none) | 主要按钮-边框-延迟时间 |
| $transition_duration-button_secondary-border | var(--semi-transition_duration-none) | 次要按钮-边框-动画持续时间 |
| $transition_function-button_secondary-border | var(--semi-transition_function-easeIn) | 次要按钮-边框-过渡曲线 |
| $transition_delay-button_secondary-border | var(--semi-transition_delay-none) | 次要按钮-边框-延迟时间 |
| $transition_duration-button_tertiary-border | var(--semi-transition_duration-none) | 三级按钮-边框-动画持续时间 |
| $transition_function-button_tertiary-border | var(--semi-transition_function-easeIn) | 三级按钮-边框-过渡曲线 |
| $transition_delay-button_tertiary-border | var(--semi-transition_delay-none) | 三级按钮-边框-延迟时间 |
| $transition_duration-button_light-border | var(--semi-transition_duration-none) | 浅色按钮-边框-动画持续时间 |
| $transition_function-button_light-border | var(--semi-transition_function-easeIn) | 浅色按钮-边框-过渡曲线 |
| $transition_delay-button_light-border | var(--semi-transition_delay-none) | 浅色按钮-边框-延迟时间 |
| $transition_duration-button_warning-border | var(--semi-transition_duration-none) | 警告按钮-边框-动画持续时间 |
| $transition_function-button_warning-border | var(--semi-transition_function-easeIn) | 警告按钮-边框-过渡曲线 |
| $transition_delay-button_warning-border | var(--semi-transition_delay-none) | 警告按钮-边框-延迟时间 |
| $transition_duration-button_danger-border | var(--semi-transition_duration-none) | 危险按钮-边框-动画持续时间 |
| $transition_function-button_danger-border | var(--semi-transition_function-easeIn) | 危险按钮-边框-过渡曲线 |
| $transition_delay-button_danger-border | var(--semi-transition_delay-none) | 危险按钮-边框-延迟时间 |
| $transform_scale-button_primary | var(--semi-transform_scale-none) | 主要按钮-放大 |
| $transform_scale-button_secondary | var(--semi-transform_scale-none) | 次要按钮-放大 |
| $transform_scale-button_tertiary | var(--semi-transform_scale-none) | 三级按钮-放大 |
| $transform_scale-button_light | var(--semi-transform_scale-none) | 浅色按钮-放大 |
| $transform_scale-button_warning | var(--semi-transform_scale-none) | 警告按钮-放大 |
| $transform_scale-button_danger | var(--semi-transform_scale-none) | 危险按钮-放大 |
| $transform_scale-button_borderless | var(--semi-transform_scale-none) | 无边框按钮-放大 |
| $animation_duration-button_icon_loading | 600ms | 加载图标容器旋转一周时长 |
| $color-button_primary-bg-default | var(--semi-color-primary) | 主要按钮背景颜色 |
| $color-button_primary-border-default | transparent | 主要按钮描边颜色 |
| $color-button_primary-text-default | var(--semi-white) | 主要按钮文字颜色 - solid 模式 |
| $color-button_primary-bg-hover | var(--semi-color-primary-hover) | 主要按钮背景颜色 - 悬浮 |
| $color-button_primary-bg-active | var(--semi-color-primary-active) | 主要按钮背景颜色 - 按下 |
| $color-button_primary_outline-focus | $color-focus-ring | 主要按钮轮廓 - 聚焦 |
| $color-button_primary_outline-border-default | var(--semi-color-border) | 主要按钮边框颜色 - 边框模式 |
| $color-button_primary_borderless-text-default | var(--semi-color-primary) | 主要按钮文字颜色 - 浅色/边框/无边框模式 |
| $color-button_primary_solid_colorful-bg-default | var(--semi-color-ai-general) | Colorful 主要按钮背景颜色 - solid 主题 |
| $color-button_primary_solid_colorful-bg-hover | var(--semi-color-ai-general-hover) | Colorful 主要按钮背景颜色 - solid 主题 - 悬浮 |
| $color-button_primary_solid_colorful-bg-active | var(--semi-color-ai-general-active) | Colorful 主要按钮背景颜色 - solid 主题 - 按下 |
| $color-button_primary_light_colorful-text-default | var(--semi-color-ai-general) | Colorful 主要按钮文字填充色 - 浅色模式 |
| $color-button_primary_light_outline-text-default | var(--semi-color-ai-purple) | Colorful 主要按钮文字颜色 - 边框模式 |
| $color-button_primary_light_outline-border | var(--semi-color-ai-purple) | Colorful 主要按钮边框颜色 - 边框模式 |
| $color-button_primary_light_borderless-text-default | var(--semi-color-ai-general) | Colorful 主要按钮文字填充色 - 无边框模式 |
| $color-button_secondary-bg-default | var(--semi-color-secondary) | 次要按钮背景颜色 |
| $color-button_secondary-border-default | var(--semi-color-secondary) | 次要按钮描边颜色 |
| $color-button_secondary-text-default | var(--semi-white) | 次要按钮文字颜色 - solid 模式 |
| $color-button_secondary-bg-hover | var(--semi-color-secondary-hover) | 次要按钮背景颜色 - 悬浮 |
| $color-button_secondary-bg-active | var(--semi-color-secondary-active) | 次要按钮背景颜色 - 按下 |
| $color-button_secondary_outline-border-default | var(--semi-color-border) | 次要按钮边框颜色 - 边框模式 |
| $color-button_secondary_borderless-text-default | var(--semi-color-secondary) | 次要按钮文字颜色 - 浅色/边框/无边框模式 |
| $color-button_danger-bg-default | var(--semi-color-danger) | 危险按钮背景颜色 |
| $color-button_danger-text-default | var(--semi-white) | 危险按钮文字颜色 - solid 模式 |
| $color-button_danger-bg-hover | var(--semi-color-danger-hover) | 危险按钮背景颜色 - 悬浮 |
| $color-button_danger-bg-active | var(--semi-color-danger-active) | 危险按钮背景颜色 - 按下 |
| $color-button_danger-outline-focus | var(--semi-color-danger-light-active) | 危险按钮轮廓 - 聚焦 |
| $color-button_danger_outline-border-default | var(--semi-color-danger) | 危险按钮边框颜色 - 边框模式 |
| $color-button_danger_borderless-text-default | var(--semi-color-danger) | 危险按钮文字颜色 - 浅色/边框/无边框模式 |
| $color-button_warning-bg-default | var(--semi-color-warning) | 警告按钮背景颜色 |
| $color-button_warning-text-default | var(--semi-white) | 警告按钮文字颜色 - solid 模式 |
| $color-button_warning-bg-hover | var(--semi-color-warning-hover) | 警告按钮背景颜色 - 悬浮 |
| $color-button_warning-bg-active | var(--semi-color-warning-active) | 警告按钮背景颜色 - 按下 |
| $color-button_warning-outline-focus | var(--semi-color-warning-light-active) | 警告按钮轮廓 - 聚焦 |
| $color-button_warning_outline-border-default | var(--semi-color-warning) | 警告按钮边框颜色 - 边框模式 |
| $color-button_warning_borderless-text-default | var(--semi-color-warning) | 警告按钮文字颜色 - 浅色/边框/无边框模式 |
| $color-button_tertiary-bg-default | var(--semi-color-tertiary) | 第三按钮背景颜色 |
| $color-button_tertiary-text-default | var(--semi-white) | 第三按钮文字颜色 - solid 模式 |
| $color-button_tertiary_solid_colorful-bg-default | var(--semi-ai-general-0) | colorful 第三按钮背景颜色 |
| $color-button_tertiary_solid_colorful-bg-hover | var(--semi-ai-general-1) | colorful 第三按钮背景颜色 - 悬浮 |
| $color-button_tertiary_solid_colorful-bg-active | var(--semi-ai-general-2) | colorful 第三按钮背景颜色 - 按下 |
| $color-button_tertiary_solid_colorful-text-default | var(--semi-color-ai-general) | Colorful 第三按钮文字填充色 - solid 主题 |
| $color-button_tertiary-bg-hover | var(--semi-color-tertiary-hover) | 第三按钮背景颜色 - 悬浮 |
| $color-button_tertiary-bg-active | var(--semi-color-tertiary-active) | 第三按钮背景颜色 - 按下 |
| $color-button_tertiary_outline-border-default | var(--semi-color-border) | 第三按钮边框颜色 - 边框模式 |
| $color-button_tertiary_solid-text-default | var(--semi-color-text-1) | 第三按钮文字颜色 - 浅色/边框/无边框模式 |
| $color-button_disabled_solid-text-default | var(--semi-color-disabled-text) | 禁用按钮文字颜色 - solid 主题 |
| $color-button_disabled-text-default | var(--semi-color-disabled-text) | 禁用按钮文字颜色 - 浅色主题或无背景 |
| $color-button_disabled_outline_text-default | var(--semi-color-disabled-text) | 禁用按钮文字颜色 - 边框模式 |
| $color-button_disabled-bg-default | var(--semi-color-disabled-bg) | 禁用按钮背景颜色 |
| $color-button_disabled-text-hover | $color-button_disabled-text-default | 禁用按钮文字颜色 - solid 主题 - 悬浮 |
| $color-button_disabled_primary-bg-default | $color-button_disabled-bg-default | 禁用 primary 按钮背景颜色 |
| $color-button_disabled_secondary-bg-default | $color-button_disabled-bg-default | 禁用 secondary 按钮背景颜色 |
| $color-button_disabled_danger-bg-default | $color-button_disabled-bg-default | 禁用 danger 按钮背景颜色 |
| $color-button_disabled_warning-bg-default | $color-button_disabled-bg-default | 禁用 warning 按钮背景颜色 |
| $color-button_disabled_tertiary-bg-default | $color-button_disabled-bg-default | 禁用 tertiary 按钮背景颜色 |
| $color-button_disabled_outline-border-default | var(--semi-color-border) | 禁用按钮边框颜色 - 边框模式 |
| $color-button_light-bg-default | var(--semi-color-fill-0) | 浅色按钮背景颜色 |
| $color-button_light-bg-hover | var(--semi-color-fill-1) | 浅色按钮背景颜色 - 悬浮 |
| $color-button_light-bg-active | var(--semi-color-fill-2) | 浅色按钮背景颜色 - 按下 |
| $color-button_light-border-default | transparent | 浅色按钮描边颜色 |
| $color-button_light-border-hover | $color-button_light-border-default | 浅色按钮描边颜色 - 悬浮 |
| $color-button_light-border-active | $color-button_light-border-hover | 浅色按钮描边颜色 - 按下 |
| $width-button_light-border | 0 | 浅色按钮描边宽度 |
| $color-button_disabled_light_primary-bg-default | $color-button_light-bg-default | 禁用 light primary 按钮背景颜色 |
| $color-button_disabled_light_secondary-bg-default | $color-button_light-bg-default | 禁用 light secondary 按钮背景颜色 |
| $color-button_disabled_light_danger-bg-default | $color-button_light-bg-default | 禁用 light danger 按钮背景颜色 |
| $color-button_disabled_light_warning-bg-default | $color-button_light-bg-default | 禁用 light warning 按钮背景颜色 |
| $color-button_disabled_light_tertiary-bg-default | $color-button_light-bg-default | 禁用 light tertiary 按钮背景颜色 |
| $color-button_borderless-bg-hover | var(--semi-color-fill-0) | 无背景按钮背景颜色 - 悬浮 |
| $color-button_borderless-bg-active | var(--semi-color-fill-1) | 无背景按钮背景颜色 - 按下 |
| $color-button_borderless-border-default | transparent | 无背景按钮描边颜色 |
| $color-button_borderless-border-hover | $color-button_borderless-border-default | 无背景按钮描边颜色 - 悬浮 |
| $color-button_borderless-border-active | $color-button_borderless-border-hover | 无背景按钮描边颜色 - 按下 |
| $width-button_borderless-border | 0 | 无背景按钮描边宽度 |
| $width-button_outline-border | 1px | 边框模式按钮边框宽度 |
| $color-button_outline-bg-hover | var(--semi-color-fill-0) | 边框模式按钮背景颜色 - 悬浮 |
| $color-button_outline-bg-active | var(--semi-color-fill-1) | 边框模式按钮背景颜色 - 按下 |
| $color-button_group-border-default | var(--semi-color-border) | 按钮组分割线颜色 |
| $width-button_group-border | $border-thickness-control | 按钮组分割线宽度 |
| $spacing-button_default-paddingTop | 6px | 按钮顶部内边距 - 默认 |
| $spacing-button_default-paddingLeft | $spacing-base-tight | 按钮左侧内边距 - 默认 |
| $spacing-button_default-paddingRight | $spacing-base-tight | 按钮右侧内边距 - 默认 |
| $spacing-button_large-paddingTop | 10px | 按钮顶部内边距 - 大尺寸 |
| $spacing-button_large-paddingBottom | 10px | 按钮底部内边距 - 大尺寸 |
| $spacing-button_large-paddingLeft | $spacing-base | 按钮左侧内边距 - 大尺寸 |
| $spacing-button_large-paddingRight | $spacing-base | 按钮右侧内边距 - 大尺寸 |
| $spacing-button_small-paddingTop | $spacing-super-tight | 按钮顶部内边距 - 小尺寸 |
| $spacing-button_small-paddingBottom | $spacing-super-tight | 按钮底部内边距 - 小尺寸 |
| $spacing-button_small-paddingLeft | $spacing-base-tight | 按钮左侧内边距 - 小尺寸 |
| $spacing-button_small-paddingRight | $spacing-base-tight | 按钮右侧内边距 - 小尺寸 |
| $spacing-button_iconOnly_default-paddingLeft | $spacing-tight | 图标按钮左侧内边距 - 默认 |
| $spacing-button_iconOnly_default-paddingRight | $spacing-tight | 图标按钮右侧内边距 - 默认 |
| $spacing-button_iconOnly_default-paddingTop | $spacing-tight | 图标按钮顶部内边距 - 默认 |
| $spacing-button_iconOnly_large-paddingLeft | $spacing-base-tight | 图标按钮左侧内边距 - 大尺寸 |
| $spacing-button_iconOnly_large-paddingRight | $spacing-base-tight | 图标按钮右侧内边距 - 大尺寸 |
| $spacing-button_iconOnly_large-paddingTop | $spacing-base-tight | 图标按钮顶部内边距 - 大尺寸 |
| $spacing-button_iconOnly_large-paddingBottom | $spacing-base-tight | 图标按钮底部内边距 - 大尺寸 |
| $spacing-button_iconOnly_small-paddingLeft | $spacing-extra-tight | 图标按钮左侧内边距 - 小尺寸 |
| $spacing-button_iconOnly_small-paddingRight | $spacing-extra-tight | 图标按钮右侧内边距 - 小尺寸 |
| $spacing-button_iconOnly_small-paddingTop | $spacing-extra-tight | 图标按钮顶部内边距 - 小尺寸 |
| $spacing-button_iconOnly_small-paddingBottom | $spacing-extra-tight | 图标按钮底部内边距 - 小尺寸 |
| $height-button_iconOnly_small | $height-control-small | 图标按钮 height - 小尺寸 |
| $width-button_iconOnly_small | $height-control-small | 图标按钮 width - 小尺寸 |
| $height-button_iconOnly_default | $height-control-default | 图标按钮 height - 默认 |
| $width-button_iconOnly_default | $height-control-default | 图标按钮 width - 默认 |
| $height-button_iconOnly_large | $height-control-large | 图标按钮 height - 大尺寸 |
| $width-button_iconOnly_large | $height-control-large | 图标按钮 width - 大尺寸 |
| $spacing-button_iconOnly_content-marginLeft | $spacing-tight | 按钮左侧图标距离文字间距 |
| $spacing-button_iconOnly_content-marginRight | $spacing-tight | 按钮右侧图标距离文字间距 |
| $font-button-fontWeight | $font-weight-bold | 按钮文字字重 - 默认 |
| $font-button-fontSize | $font-size-regular | 按钮文字字号- 默认 |
| $font-button-lineHeight | 20px | 按钮文字行高 - 默认 |
| $font-button_small-fontWeight | $font-weight-bold | 按钮文字字重 - 小尺寸 |
| $font-button_small-fontSize | $font-size-regular | 按钮文字字号- 小尺寸 |
| $font-button_small-lineHeight | 20px | 按钮文字行高 - 小尺寸 |
| $font-button_large-fontWeight | $font-weight-bold | 默认按钮文字字重 - 大尺寸 |
| $font-button_large-fontSize | $font-size-regular | 默认按钮文字字号 - 大尺寸 |
| $font-button_large-lineHeight | 20px | 默认按钮文字行高 - 大尺寸 |
| $height-button_large | $height-control-large | 按钮高度 - 大尺寸 |
| $height-button_small | $height-control-small | 按钮高度 - 小尺寸 |
| $height-button_default | $height-control-default | 按钮高度 - 默认 |
| $height-button_group_line_default | 20px | 分割线高度 - 默认 |
| $width-button-border | $border-thickness | 按钮描边宽度 |
| $radius-button | var(--semi-border-radius-small) | 按钮圆角大小 |
| $radius-button_group | $radius-button | 按钮组圆角大小 |
| $width-button-outline | $width-focus-ring | 按钮轮廓宽度 |
| $radius-button_splitButtonGroup_first_topLeft | var(--semi-border-radius-small) | 组合按钮(Split) - 首个按钮左上圆角 |
| $radius-button_splitButtonGroup_first_bottomLeft | var(--semi-border-radius-small) | 组合按钮(Split) - 首个按钮左下圆角 |
| $radius-button_splitButtonGroup_last_topRight | var(--semi-border-radius-small) | 组合按钮(Split) - 末尾按钮右上圆角 |
| $radius-button_splitButtonGroup_last_bottomRight | var(--semi-border-radius-small) | 组合按钮(Split) - 末尾按钮右下圆角 |
FAQ
-
Why is the icon of Button not shown?
The icon is passed through the#iconslot, not aniconprop:<Button><template #icon><IconCamera /></template></Button>.

