MCPcopy
hub / github.com/tabler/tabler-icons / Component

Function Component

packages/icons-preact/src/createPreactComponent.ts:11–45  ·  view source on GitHub ↗
({
    color = 'currentColor',
    size = 24,
    stroke = 2,
    title,
    children,
    className = '',
    class: classes = '',
    style,
    ...rest
  }: IconProps)

Source from the content-addressed store, hash-verified

9 iconNode: IconNode,
10): Icon => {
11 const Component = ({
12 color = 'currentColor',
13 size = 24,
14 stroke = 2,
15 title,
16 children,
17 className = '',
18 class: classes = '',
19 style,
20 ...rest
21 }: IconProps) =>
22 h(
23 'svg' as any,
24 {
25 ...defaultAttributes[type],
26 width: String(size),
27 height: String(size),
28 class: [`tabler-icon`, `tabler-icon-${iconName}`, classes, className].join(' '),
29 ...(type === 'filled'
30 ? {
31 fill: color,
32 }
33 : {
34 'stroke-width': stroke,
35 stroke: color,
36 }),
37 style,
38 ...rest,
39 },
40 [
41 title && h('title', {}, title),
42 ...iconNode.map(([tag, attrs]) => h(tag, attrs)),
43 ...toChildArray(children),
44 ],
45 );
46
47 Component.displayName = `${iconNamePascal}`;
48

Callers 5

TestHostComponentClass · 0.50
TestHostComponentClass · 0.50
TestHostComponentClass · 0.50
app.component.tsFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected