BUTTON
图标文字按钮Icon Label Button
图标在左、文字在右,主按钮和次按钮用同一套尺寸,图标跟着文字变色。
中英对照
- 中文
- 图标文字按钮
- 英文
- Icon Label Button
- 别名
- 带图标按钮、左图标按钮、Icon + Label
- 一句话
- 图标在左、文字在右,主按钮和次按钮用同一套尺寸,图标跟着文字变色。
效果预览
常见变体
尾随图标Trailing Icon Button
图标放在文字右边,表达结果或去向:外部链接 ↗、展开下拉 ▾;和左侧图标不要同时出现。
适合用在哪
下载、分享、联系销售,以及任何图标能缩短理解时间的主操作。
不适合:一排三颗以上的同级按钮都配图标时,图标失去「帮你更快认出」的作用,只剩视觉噪点;表格行内、卡片底部这类密集操作区,改用纯图标按钮或纯文字链接更清爽。
和相近模式的区别
图标按钮Icon Button
图标按钮去掉了文字,只适合含义通用的高频操作,必须靠 aria-label 和 tooltip;图标文字按钮保留文字,图标只是帮用户更快认出动作,可访问名称直接来自可见文字。
容易踩的坑
- 加了图标就把按钮加高,和同一行的纯文字按钮对不齐。
- 图标颜色写死,悬停文字变了图标还是原来的颜色。
- 放一个和文案无关的装饰图标,读屏隐藏了图标之后,明眼用户反而更迷惑。
设计提示词 · Prompt
图标文字按钮(Icon Label Button):图标在左、文字在右,间距 6-8px,图标 16px,与文字垂直居中。主按钮实心、次按钮描边,高度、圆角、左右内边距与纯文字按钮完全一致,不要因为加了图标就加高。图标用 currentColor,悬停时跟文字一起变色。装饰性图标加 aria-hidden,可访问名称来自旁边的文字。图标要替文字省掉一个词(下载、邮件、外部链接),不要再放一个和文案无关的装饰。
Icon Label Button: icon on the left, label on the right, 6-8px gap, 16px icon, vertically centered with the text. The solid primary and the outlined secondary share the exact height, radius and horizontal padding of a text-only button — don't grow the control just because an icon was added. The icon uses currentColor so it recolors with the label on hover. Decorative icons are aria-hidden; the accessible name comes from the text. The icon should save a word the label would otherwise need (download, mail, external link), not add an unrelated ornament.
可复制 CSS
自包含的最小实现,粘贴到空白页面即可生效;类名可以按项目规范改名。
/* <button class="il-btn" type="button"><svg class="il-btn__icon" aria-hidden="true" viewBox="0 0 24 24">…</svg>下载报告</button>
这里按线性图标写 stroke;面性图标把 fill 改成 currentColor */
.il-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
height: 44px;
padding: 0 20px;
border: 1px solid transparent;
border-radius: 8px;
background: #111827;
color: #fff;
font: 600 15px/1 system-ui, sans-serif;
cursor: pointer;
transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.il-btn__icon {
display: block;
flex: none;
width: 16px;
height: 16px;
fill: none;
stroke: currentColor;
stroke-width: 2;
}
.il-btn:hover { background: #1f2937; }
.il-btn--secondary { background: #fff; color: #111827; border-color: #d1d5db; }
.il-btn--secondary:hover { background: #f9fafb; color: #4338ca; border-color: #a5b4fc; }
.il-btn:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
.il-btn { transition: none; }
}
演示 HTML 结构
<div class="s d-iconlabel"> <button class="d-btn d-btn--p" type="button"><span class="d-il__ic" aria-hidden="true">↓</span>下载报告</button> <button class="d-btn d-btn--g" type="button"><span class="d-il__ic" aria-hidden="true">✉</span>联系销售</button> </div>
无障碍要点
- 图标加 aria-hidden="true",按钮名称只来自可见文字。
- 不要再给按钮加与文字不同的 aria-label:它会覆盖可见文字成为名称,违反 SC 2.5.3「名称包含可见标签」,语音控制用户说出看到的文字时会触发不了。
常见问题
图标文字按钮的英文是什么?
图标文字按钮的英文是 Icon Label Button。常见英文别名还包括 Icon + Label。
Icon Label Button 的中文是什么?
Icon Label Button 的中文是「图标文字按钮」。常见中文别名还包括 带图标按钮、左图标按钮。图标在左、文字在右,主按钮和次按钮用同一套尺寸,图标跟着文字变色。
按钮里的图标怎么和文字垂直居中?
按钮用 display: inline-flex 加 align-items: center,图标设 display: block,并加 flex: none 防止被压缩。内联 SVG 默认按文字基线对齐,下方会留出给字母降部的空隙,看起来偏上;交给 flex 居中就不会有这个问题。
图标放在文字左边还是右边?
常见约定是:左侧图标说明动作类型(下载、添加、分享),右侧图标说明结果或去向(外部链接、展开下拉、下一步箭头)。一颗按钮只放一侧,整站保持同一套约定。
常见搭配
同一页面里经常和「图标文字按钮」一起出现的模式,可以收藏后用「组合收藏为整页提示词」一起交给 AI。