MCPcopy Create free account
hub / github.com/anomalyco/opencode / Icon

Function Icon

packages/ui/src/components/icon.tsx:148–169  ·  view source on GitHub ↗
(props: IconProps)

Source from the content-addressed store, hash-verified

146}
147
148export function Icon(props: IconProps) {
149 const [local, others] = splitProps(props, ["name", "size", "class", "classList"])
150 onMount(ensureSprite)
151
152 return (
153 <div data-component="icon" data-size={local.size || "normal"}>
154 <svg
155 data-slot="icon-svg"
156 classList={{
157 ...local.classList,
158 [local.class ?? ""]: !!local.class,
159 }}
160 fill="none"
161 viewBox={viewBox(local.name)}
162 aria-hidden="true"
163 {...others}
164 >
165 <use href={`#${symbol(local.name)}`} />
166 </svg>
167 </div>
168 )
169}

Callers

nothing calls this directly

Calls 2

viewBoxFunction · 0.85
symbolFunction · 0.70

Tested by

no test coverage detected