1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
|
// @ts-nocheck
import * as mod from "./icon"
import { create } from "../storybook/scaffold"
const docs = `### Overview
Inline icon renderer using the built-in OpenCode icon set.
Use with \`Button\`, \`IconButton\`, and menu items.
### API
- Required: \`name\` (icon key).
- Optional: \`size\` (small | normal | medium | large).
- Accepts standard SVG props.
### Variants and states
- Size variants only.
### Behavior
- Uses an internal SVG path map.
### Accessibility
- Icons are aria-hidden by default; wrap with accessible text when needed.
### Theming/tokens
- Uses \`data-component="icon"\` with size data attributes.
`
const names = [
"align-right",
"arrow-up",
"arrow-left",
"arrow-right",
"archive",
"bubble-5",
"prompt",
"brain",
"bullet-list",
"check-small",
"chevron-down",
"chevron-left",
"chevron-right",
"chevron-grabber-vertical",
"chevron-double-right",
"circle-x",
"close",
"close-small",
"checklist",
"console",
"expand",
"collapse",
"code",
"code-lines",
"circle-ban-sign",
"edit-small-2",
"eye",
"enter",
"folder",
"file-tree",
"file-tree-active",
"magnifying-glass",
"plus-small",
"plus",
"new-session",
"pencil-line",
"mcp",
"glasses",
"magnifying-glass-menu",
"window-cursor",
"task",
"stop",
"layout-left",
"layout-left-partial",
"layout-left-full",
"layout-right",
"layout-right-partial",
"layout-right-full",
"square-arrow-top-right",
"open-file",
"speech-bubble",
"comment",
"folder-add-left",
"github",
"discord",
"layout-bottom",
"layout-bottom-partial",
"layout-bottom-full",
"dot-grid",
"circle-check",
"copy",
"check",
"photo",
"share",
"download",
"menu",
"server",
"branch",
"edit",
"help",
"settings-gear",
"dash",
"cloud-upload",
"trash",
"sliders",
"keyboard",
"selector",
"arrow-down-to-line",
"warning",
"link",
"providers",
"models",
]
const story = create({ title: "UI/Icon", mod, args: { name: "check" } })
export default {
title: "UI/Icon",
id: "components-icon",
component: story.meta.component,
tags: ["autodocs"],
parameters: {
docs: {
description: {
component: docs,
},
},
},
argTypes: {
name: {
control: "select",
options: names,
},
size: {
control: "select",
options: ["small", "normal", "medium", "large"],
},
},
}
export const Basic = story.Basic
export const Sizes = {
render: () => (
<div style={{ display: "flex", gap: "12px", "align-items": "center" }}>
<mod.Icon name="check" size="small" />
<mod.Icon name="check" size="normal" />
<mod.Icon name="check" size="medium" />
<mod.Icon name="check" size="large" />
</div>
),
}
export const Gallery = {
render: () => (
<div
style={{
display: "grid",
gap: "12px",
"grid-template-columns": "repeat(auto-fill, minmax(88px, 1fr))",
}}
>
{names.map((name) => (
<div style={{ display: "grid", gap: "6px", "justify-items": "center" }}>
<mod.Icon name={name} />
<div style={{ "font-size": "10px", color: "var(--text-weak)", "text-align": "center" }}>{name}</div>
</div>
))}
</div>
),
}
|