@ asinative/ icons( 秒数)
BaseNative UI 组件最小 SVG 图标集
部分 基础 生态系统——一个基于信号的网络运行时间超过本土的HTML.
安装
npm install @basenative/icons
快速启动
// Inline an SVG icon in a server-rendered template
import { readFileSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import { join, dirname } from 'node:path';
const __dirname = dirname(fileURLToPath(import.meta.url));
function icon(name) {
return readFileSync(
join(__dirname, 'node_modules/@basenative/icons/src', `${name}.svg`),
'utf-8'
);
}
const html = `
<button type="button">
${icon('plus')} Add item
</button>
`;
带有 @ aslative/ server
import { render } from '@basenative/server';
import { readFileSync } from 'node:fs';
const plusIcon = readFileSync('./node_modules/@basenative/icons/src/plus.svg', 'utf-8');
const html = render('<button>{{ icon }} Add</button>', { icon: plusIcon });
可用图标
图标居住于 src/ 简单 .svg 文档。 每个 SVG 大小为内置使用并继承 currentColor。 。 。 .
| 文件 | 说明 |
|---|---|
activity.svg | 脉冲/活性饲料 |
bar-chart.svg | 条形图/报告 |
calendar.svg | 日历/ 预定任务 |
check.svg | 检查标记/ 确认 |
chevron-down.svg | 下下切夫龙的倒下 |
chevron-left.svg | 左切夫龙 / 后 |
chevron-right.svg | 右切夫龙 / 前置 |
clock.svg | 时钟/ 时间 |
dashboard.svg | Dashboard 网格 / 今天视图 |
file-text.svg | 文件/估计数 |
mail.svg | 信封/ 电子邮件 |
map-pin.svg | 位置标 |
megaphone.svg | 麦克风/运动 |
menu.svg | 汉堡菜单 |
message-square.svg | 用信件行聊天泡 |
minus.svg | 减/ 删除/倒塌 |
package.svg | 方框/库存 |
phone.svg | 电话话筒 |
plug.svg | 插件/ 插件和集成 |
plus.svg | 加/ 加/扩展 |
remove.svg | X / 结案/解雇 |
search.svg | 放大玻璃/ 搜索 |
settings.svg | 齿轮/ 设置 |
shield.svg | 盾牌/信任和保护 |
star.svg | 明星/评论和评分 |
trending-up.svg | 上升图/机会 |
truck.svg | 卡车/车辆 |
user-plus.svg | 有附加/新铅的人 |
users.svg | 人/客户 |
样式
图标继承 color 从母元素通过 currentColor 缩放 em编号 :font-size。应用类或内置宽度/高度来控制大小 :
.icon { width: 1em; height: 1em; vertical-align: middle; }
许可证
阿帕奇 - 2.0