按钮:规格
按钮用于让用户执行界面中的大多数操作。
变体

- 默认按钮
- 切换按钮
| 变体 | M3 | M3 Expressive |
|---|---|---|
| 默认 | 支持 | 支持 |
| 切换(选择) | -- | 支持 |
配置

- 尺寸
- 形状
- 颜色
- 小按钮内边距
| 类别 | 配置 | M3 | M3 Expressive |
|---|---|---|---|
| 尺寸 | 小(默认) | 支持 | 支持 |
| XS, M, L, XL | -- | 支持 | |
| 形状 | 全圆角(默认) | 支持 | 支持 |
| 方形 | -- | 支持 | |
| 颜色 | 凸起、填充(默认)、色调、描边、文本 | 支持 | 支持 |
| 小按钮内边距 | 24dp | 支持 | 不推荐。请使用 16dp |
| 16dp | -- | 支持 |
令牌与规格
使用表格菜单选择令牌集。按钮令牌集分为通用令牌、颜色和尺寸。查看基线令牌
按钮 - 颜色 - 凸起
主题
对比度
按钮 - 颜色 - 填充
主题
对比度
按钮 - 颜色 - 色调
主题
对比度
按钮 - 颜色 - 描边
主题
对比度
按钮 - 颜色 - 文本
主题
对比度
按钮 - 尺寸 - 超小
| Token | 取值 |
|---|---|
| Button xsmall container height | 32dp |
| Button xsmall outline width | 1dp |
| Button xsmall label font | Roboto |
| Button xsmall label line height | 20pt |
| Button xsmall label size | 14pt |
| Button xsmall label weight | 500 |
| Button xsmall label tracking | 0.1pt |
| Button xsmall icon size | 20dp |
| Button xsmall shape round | Circular |
| Button xsmall shape square | 12dp |
| Button xsmall leading space | 12dp |
| Button xsmall between icon label space | 4dp |
| Button xsmall trailing space | 12dp |
| Button xsmall shape pressed morph | 8dp |
| Button xsmall shape spring animation damping | 0.9 |
| Button xsmall shape spring animation stiffness | 1400 |
| Button xsmall selected container shape round | 12dp |
| Button xsmall selected container shape square | Circular |
按钮 - 尺寸 - 小
| Token | 取值 |
|---|---|
| Button small container height | 40dp |
| Button small outline width | 1dp |
| Button small label font | Roboto |
| Button small label line height | 20pt |
| Button small label size | 14pt |
| Button small label weight | 500 |
| Button small label tracking | 0.1pt |
| Button small icon size | 20dp |
| Button small shape round | Circular |
| Button small shape square | 12dp |
| Button small leading space | 16dp |
| Button small between icon label space | 8dp |
| Button small trailing space | 16dp |
| Button small shape pressed morph | 8dp |
| Button small shape spring animation damping | 0.9 |
| Button small shape spring animation stiffness | 1400 |
| Button small selected container shape round | 12dp |
| Button small selected container shape square | Circular |
按钮 - 尺寸 - 中
| Token | 取值 |
|---|---|
| Button medium container height | 56dp |
| Button medium outline width | 1dp |
| Button medium label font | Roboto |
| Button medium label line height | 24pt |
| Button medium label size | 16pt |
| Button medium label weight | 500 |
| Button medium label tracking | 0.15pt |
| Button medium icon size | 24dp |
| Button medium shape round | Circular |
| Button medium shape square | 16dp |
| Button medium leading space | 24dp |
| Button medium between icon label space | 8dp |
| Button medium trailing space | 24dp |
| Button medium shape pressed morph | 12dp |
| Button medium shape spring animation damping | 0.9 |
| Button medium shape spring animation stiffness | 1400 |
| Button medium selected container shape round | 16dp |
| Button medium selected container shape square | Circular |
按钮 - 尺寸 - 大
| Token | 取值 |
|---|---|
| Button large container height | 96dp |
| Button large outline width | 2dp |
| Button large label font | Roboto |
| Button large label line height | 32pt |
| Button large label size | 24pt |
| Button large label weight | 400 |
| Button large label tracking | 0 |
| Button large icon size | 32dp |
| Button large shape round | Circular |
| Button large shape square | 28dp |
| Button large leading space | 48dp |
| Button large between icon label space | 12dp |
| Button large trailing space | 48dp |
| Button large shape pressed morph | 16dp |
| Button large shape spring animation damping | 0.9 |
| Button large shape spring animation stiffness | 1400 |
| Button large selected container shape round | 28dp |
| Button large selected container shape square | Circular |
按钮 - 尺寸 - 超大
| Token | 取值 |
|---|---|
| Button xlarge container height | 136dp |
| Button xlarge outline width | 3dp |
| Button xlarge label font | Roboto |
| Button xlarge label line height | 40pt |
| Button xlarge label size | 32pt |
| Button xlarge label weight | 400 |
| Button xlarge label tracking | 0 |
| Button xlarge icon size | 40dp |
| Button xlarge shape round | Circular |
| Button xlarge shape square | 28dp |
| Button xlarge leading space | 64dp |
| Button xlarge between icon label space | 16dp |
| Button xlarge trailing space | 64dp |
| Button xlarge shape pressed morph | 16dp |
| Button xlarge shape spring animation damping | 0.9 |
| Button xlarge shape spring animation stiffness | 1400 |
| Button xlarge selected container shape round | 28dp |
| Button xlarge selected container shape square | Circular |
结构

- 容器
- 标签文本
- 图标(可选)
颜色
颜色值通过 设计令牌设计令牌是所有 UI 元素的构建块。相同的令牌用于设计、工具和代码中。更多关于令牌实现。对设计师而言,这意味着使用与令牌对应的颜色值;在实现中,颜色值是一个引用具体数值的令牌。
- 有五种内置的按钮颜色样式:凸起、填充、色调、描边和文本
- 默认按钮和切换按钮使用不同的颜色
- 切换按钮不使用文本样式
TIP
这些颜色角色旨在确保设计一致性并营造熟悉感。只要容器颜色与文本颜色的对比度达到 3:1,也可以使用其他颜色角色,例如 tertiary 和 on tertiary。

A. 凸起、B. 填充、C. 色调、D. 描边、E. 文本
- 默认
- 切换:未选中
- 切换:已选中
| 1. 默认 | 2. 切换:未选中 | 3. 切换:已选中 | |
|---|---|---|---|
| 凸起容器 凸起图标和标签 | 表面容器(低) 主色 | 表面容器(低) 主色 | 主色 主色之上 |
| 填充容器 填充图标和标签 | 主色 主色之上 | 表面容器 表面变体之上 | 主色 主色之上 |
| 色调容器 色调图标和标签 | 次色容器 次色容器之上 | 次色容器 次色容器之上 | 次色 次色之上 |
| 描边容器 描边图标和标签 | 轮廓变体(outline) 表面变体之上 | 轮廓变体(outline) 表面变体之上 | 反向表面 反向表面之上 |
| 文本图标和标签 | 主色 | -- | -- |
状态
状态状态显示组件或 UI 元素的交互状态。更多关于状态是用于传达组件或交互元素当前状态的可视化表示。凸起按钮状态
凸起按钮样式的默认海拔(elevation)为 1,禁用时为 0。
默认

- 启用
- 禁用
- 悬停
- 聚焦
- 按下
切换

A. 未选中、B. 已选中
- 启用
- 禁用
- 悬停
- 聚焦
- 按下
填充按钮状态
默认

- 启用
- 禁用
- 悬停
- 聚焦
- 按下
切换

A. 未选中、B. 已选中
- 启用
- 禁用
- 悬停
- 聚焦
- 按下
色调按钮状态
默认

- 启用
- 禁用
- 悬停
- 聚焦
- 按下
切换

A. 未选中、B. 已选中
- 启用
- 禁用
- 悬停
- 聚焦
- 按下
描边按钮状态
描边按钮的容器填充在默认(静止)状态下不可见;但在禁用、悬停、聚焦或按下时,其不透明度和状态层的表现与其他按钮样式相同。
默认

- 启用
- 禁用
- 悬停
- 聚焦
- 按下
切换

- 启用
- 禁用
- 悬停
- 聚焦
- 按下
文本按钮样式状态
文本按钮的容器在默认(静止)状态下不可见;但在禁用、悬停、聚焦或按下时,其不透明度和状态层的表现与其他按钮样式相同。文本按钮没有切换样式。

- 启用
- 禁用
- 悬停
- 聚焦
- 按下
形状变形

A. 全圆角按钮、B. 方形按钮
- 启用
- 悬停
- 按下
选中时
除了按下时改变形状外,切换按钮在选中时默认形状也会从全圆角(未选中)变为方形(已选中)。
如果未选中时的默认形状为方形,则选中时的形状应为全圆角。

A. 全圆角按钮、B. 方形按钮
- 启用
- 悬停
- 按下
- 已选中
测量值

各按钮尺寸的内边距和尺寸标注
- 超小
- 小
- 中
- 大
- 超大
目标区域
为确保无障碍,超小(XS)和小(S)图标按钮必须具有 48x48dp 或更大的目标尺寸。

A. 超小 B. 小
- 全圆角按钮
- 带图标的按钮
- 方形按钮
圆角尺寸

| XS | S | M | L | XL | |
|---|---|---|---|---|---|
| A. 全圆角按钮 | 全圆角 | 全圆角 | 全圆角 | 全圆角 | 全圆角 |
| B. 方形按钮 | 12dp | 12dp | 16dp | 28dp | 28dp |
| C. 按下状态 | 8dp | 8dp | 12dp | 16dp | 16dp |
基线令牌
使用表格菜单切换令牌集。基线按钮令牌集按颜色组织。
[已弃用] 按钮 - 凸起
主题
对比度
[已弃用] 按钮 - 填充
主题
对比度
[已弃用] 按钮 - 色调
主题
对比度
[已弃用] 按钮 - 描边
主题
对比度
[已弃用] 按钮 - 文本
主题
对比度