{"record":{"id":"413f17b1bc6da29a","repo":"reflex-dev/reflex","slug":"f-passing-multiple-children-to-icon-component-is-n","errorCode":null,"errorMessage":"f\"Passing multiple children to Icon component is not allowed: remove positional arguments {children[1:]} to fix\"","messagePattern":"f\"Passing multiple children to Icon component is not allowed: remove positional arguments (.+?) to fix\"","errorType":"validation","errorClass":"AttributeError","httpStatus":null,"severity":"error","filePath":"packages/reflex-components-lucide/src/reflex_components_lucide/icon.py","lineNumber":59,"sourceCode":"            **props: The keyword arguments\n\n        Returns:\n            The created component.\n\n        Raises:\n            AttributeError: The errors tied to bad usage of the Icon component.\n            TypeError: If the icon name is not a string.\n        \"\"\"\n        if children:\n            if len(children) == 1:\n                child = Var.create(children[0]).guess_type()\n                if not isinstance(child, StringVar):\n                    msg = f\"Icon name must be a string, got {children[0]._var_type if isinstance(children[0], Var) else children[0]}\"\n                    raise AttributeError(msg)\n                props[\"tag\"] = children[0]\n            else:\n                msg = f\"Passing multiple children to Icon component is not allowed: remove positional arguments {children[1:]} to fix\"\n                raise AttributeError(msg)\n        if \"tag\" not in props:\n            msg = \"Missing 'tag' keyword-argument for Icon\"\n            raise AttributeError(msg)\n\n        tag_var: Var | LiteralVar = Var.create(props.pop(\"tag\"))\n        if isinstance(tag_var, LiteralVar):\n            if isinstance(tag_var, LiteralStringVar):\n                tag = format.to_snake_case(tag_var._var_value.lower())\n            else:\n                msg = f\"Icon name must be a string, got {type(tag_var)}\"\n                raise TypeError(msg)\n        elif isinstance(tag_var, Var):\n            tag_stringified = tag_var.guess_type()\n            if not isinstance(tag_stringified, StringVar):\n                msg = f\"Icon name must be a string, got {tag_var._var_type}\"\n                raise TypeError(msg)\n            return DynamicIcon.create(name=tag_stringified.replace(\"_\", \"-\"), **props)\n","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/reflex-dev/reflex/blob/45b8ed5ab735f8a56bbb09a42384f030eb0208e7/packages/reflex-components-lucide/src/reflex_components_lucide/icon.py#L41-L77","documentation":"rx.icon() from reflex-components-lucide takes exactly one positional child — the icon name. Multiple positional arguments mean the developer likely passed children like a normal layout component, but Icon renders a single SVG by tag, so Reflex raises AttributeError listing the offending extra arguments.","triggerScenarios":"rx.icon('home', 'settings'), rx.icon(*['home','x']), or passing an icon name plus additional elements.","commonSituations":"Copy-pasting from rx.box(...)-style code, or unpacking a list of icon names into rx.icon().","solutions":["Keep only one positional icon name: rx.icon('home')","Render multiple icons as siblings: rx.hstack(rx.icon('home'), rx.icon('settings'))"],"exampleFix":"# before\nrx.icon('home', 'settings')\n# after\nrx.hstack(rx.icon('home'), rx.icon('settings'))","handlingStrategy":"validation","validationCode":"assert len(icon_args) == 1, 'pass exactly one icon name'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never unpack lists into rx.icon; map over them instead"],"tags":["reflex","lucide","icon","too-many-children"],"backgroundTag":"component-child-type-mismatch","analyzedSha":"45b8ed5ab735f8a56bbb09a42384f030eb0208e7","analyzedAt":"2026-08-28T19:25:27.644Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}