Icon
以 currentColor 绘制的内联 SVG 图标——无需图标字体,也无需额外请求。
可用框架
Angular: 可用 Vue: 可用 React: 可用 React Native: 可用
用法
<div class="demo-stack">
<div class="demo-row" style="align-items: flex-end">
<sone-icon icon="sparkles" size="xs" />
<sone-icon icon="sparkles" size="sm" />
<sone-icon icon="sparkles" size="base" />
<sone-icon icon="sparkles" size="lg" />
<sone-icon icon="sparkles" size="xl" />
</div>
<div class="demo-row" style="align-items: center">
<!-- Icons draw in currentColor; give a label only when the icon carries the meaning alone -->
<span style="color: var(--text-secondary)"><sone-icon icon="lock" label="Locked" /></span>
<span style="color: var(--danger)"><sone-icon icon="alert-circle" label="Error" /></span>
</div>
<div class="demo-row" style="align-items: center">
<button soneBtn variant="outline" type="button"><sone-icon icon="plus" inline="start" /> New note</button>
<button soneBtn variant="outline" type="button">Next <sone-icon icon="chevron-right" inline="end" /></button>
<button soneBtn variant="ghost" size="icon" type="button" aria-label="Search"><sone-icon icon="search" /></button>
</div>
</div>导入
import {
SoneIconComponent,
} from "@surface-one/angular/icon";API 参考
SoneIconComponent组件
| 名称 | 类型 | 默认值 |
|---|---|---|
icon必填 | ShellIcon | — |
size | IconSize | null | null |
label | string | null | null |
inline | "start" | "end" | null | null |