---
title: "Icons コンポーネント — zenit Zig UI"
description: "プロバイダーに依存しないセマンティックなアイコンロール、サイズ、着色。コンポーネントは system_icons のロールにのみ依存し、アイコンプロバイダーを差し替えてもコン…"
url: https://zenit.z.express/ja/components/icons
language: ja
alternate_en: https://zenit.z.express/components/icons.md
alternate_zh: https://zenit.z.express/zh/components/icons.md
alternate_es: https://zenit.z.express/es/components/icons.md
alternate_ko: https://zenit.z.express/ko/components/icons.md
alternate_fr: https://zenit.z.express/fr/components/icons.md
alternate_de: https://zenit.z.express/de/components/icons.md
project: zenit v0.1.0-alpha (Zig 0.15.2, macOS)
source: https://github.com/version-next/zenit
---

# Icons

`ui.system_icons`

プロバイダーに依存しないセマンティックなアイコンロール、サイズ、着色。

[Video](https://zenit.z.express/media/stories/icons.mp4?v=6dffffbd52)

**BEHAVIOR CONTRACT**

コンポーネントは system\_icons のロールにのみ依存し、アイコンプロバイダーを差し替えてもコンポーネント API は変わりません。

**RECORDED INTERACTION**

仮想カーソルがセマンティックアイコン、サイズ、tint をなぞります。

`examples/storybook/stories.zig:3196`

```zig
pub fn buildIconGallery(scope: *ui.Scope, cx: *ui.Cx) anyerror!*ui.Node {
    const a = cx.allocator;
    const c = try col(cx, 12);
    try c.appendChild(a, try label(cx, "System icon contract (provider-neutral subset)"));

    // wrap 成多行网格：每行 6 个。
    var current_row = try row(cx, 8);
    var in_row: usize = 0;
    inline for (GALLERY_ICONS) |spec| {
        if (in_row == 6) {
            try c.appendChild(a, current_row);
            current_row = try row(cx, 8);
            in_row = 0;
        }
        try current_row.appendChild(a, try iconCell(scope, cx, spec.asset, spec.name));
        in_row += 1;
    }
    try c.appendChild(a, current_row);

    // 尺寸 + tint 演示行
    try c.appendChild(a, try label(cx, "Sizes & tints"));
    const demo = try row(cx, 16);
    inline for (.{ 16, 24, 32, 48 }) |sz| {
        try demo.appendChild(a, try ui.iconTint(cx, ui.system_icons.alert, light.color.fg_secondary, .{
            .width = .{ .px = @as(f32, sz) },
            .height = .{ .px = @as(f32, sz) },
        }));
    }
    try demo.appendChild(a, try ui.iconTint(cx, ui.system_icons.heart, .{ .r = 220, .g = 40, .b = 60, .a = 255 }, .{
        .width = .{ .px = 32 },
        .height = .{ .px = 32 },
    }));
    try c.appendChild(a, demo);
    return c;
}
```

[GitHub でソースを見るexamples/storybook/stories.zig:3196](https://github.com/version-next/zenit/blob/HEAD/examples/storybook/stories.zig#L3196)

Storybook にあるこの story のコードそのままです（zenit 5f9add5+wip 2026-09-30）。`W` は `ui.widgets` のことで、`col` / `row` / `label` は Storybook 内の小さなレイアウトヘルパーです。
