按钮
button不描边的胶囊。主按钮是实心墨黑(signal 主题下是信号橙),其余是浅色填充、白色浮起、透明和危险。
什么时候用一页只放一个主按钮,写「动词 + 对象」;其余动作用次按钮、透明按钮或行尾菜单。
看代码
规格写法(智能体优先用它)
{
"type": "Buttons",
"items": [
{
"label": "发布",
"name": "app.publish"
},
{
"label": "保存草稿",
"name": "app.save",
"style": "secondary"
},
{
"label": "取消",
"name": "app.cancel",
"style": "ghost"
}
]
}HTML
<div class="aidc-row">
<button type="button" class="aidc-btn">发布</button>
<button type="button" class="aidc-btn aidc-btn--secondary">保存草稿</button>
<button type="button" class="aidc-btn aidc-btn--outline">预览</button>
<button type="button" class="aidc-btn aidc-btn--ghost">取消</button>
<button type="button" class="aidc-btn aidc-btn--destructive">删除</button>
</div>
<div class="aidc-row">
<button type="button" class="aidc-btn aidc-btn--sm">小</button>
<button type="button" class="aidc-btn aidc-btn--lg">大</button>
<button type="button" class="aidc-btn aidc-btn--secondary aidc-btn--icon" aria-label="刷新"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a9 9 0 1 1-3-6.7L21 8"/><path d="M21 3v5h-5"/></svg></button>
<button type="button" class="aidc-btn" aria-busy="true"><span class="aidc-loader" data-variant="dial" role="status" aria-label="Loading"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i></span>提交中</button>
<button type="button" class="aidc-btn aidc-btn--secondary" disabled>不能点</button>
<a class="aidc-btn aidc-btn--link" href="#">查看说明</a>
</div>