How Solid differs from React
Solid's JSX maps attributes straight to the DOM, so SVG attributes such as stroke-width and class are kept exactly as they appear in the file. There is no need to rename them to camelCase or className as you would in React.
Props in Solid are reactive getters, so destructuring them breaks reactivity. When you enable the size prop, the converter uses splitProps to separate size from the remaining props and spreads the rest onto the <svg>, keeping every value reactive.
Generated TypeScript types
Props are typed as JSX.SvgSVGAttributes<SVGSVGElement> imported from solid-js, which covers every SVG attribute and event handler. With the size option the type is extended with { size?: number | string }.
Using the component in SolidStart
Getting started:
- Save the output as IconName.tsx in your src/components folder.
- Import it and render <IconName size={18} class="icon" />.
- Use currentColor to inherit color from the surrounding text.
- Refs work through the normal ref prop; forwardRef is not needed in Solid.