Skip to content

Icons not loading in mo.md and mo.ui.button #6999

@MaWeffm

Description

@MaWeffm

Describe the bug

Iconify lucide icons are loading when used directly:

mo.icon('lucide:leaf', color="red")

but not when used in mo.md:

mo.md(f"# {mo.icon('lucide:leaf', color='red')}")

and neither in mo.ui.button.

Screenshot:

Image

Will you submit a PR?

  • Yes

Environment

{
  "marimo": "0.17.2",
  "editable": false,
  "location": "/home/user/PycharmProjects/MO_dev_1/.venv/lib/python3.12/site-packages/marimo",
  "OS": "Linux",
  "OS Version": "6.14.0-33-generic",
  "Processor": "x86_64",
  "Python Version": "3.12.3",
  "Locale": "en_US",
  "Binaries": {
    "Browser": "--",
    "Node": "v22.21.0"
  },
  "Dependencies": {
    "click": "8.3.0",
    "docutils": "0.22.2",
    "itsdangerous": "2.2.0",
    "jedi": "0.19.2",
    "markdown": "3.9",
    "narwhals": "2.9.0",
    "packaging": "25.0",
    "psutil": "7.1.1",
    "pygments": "2.19.2",
    "pymdown-extensions": "10.16.1",
    "pyyaml": "6.0.3",
    "starlette": "0.48.0",
    "tomlkit": "0.13.3",
    "typing-extensions": "4.15.0",
    "uvicorn": "0.38.0",
    "websockets": "15.0.1"
  },
  "Optional Dependencies": {
    "loro": "1.8.2",
    "pandas": "2.3.3"
  },
  "Experimental Flags": {}
}

Code to reproduce

import marimo

__generated_with = "0.17.2"
app = marimo.App(width="full")


@app.cell
def _(mo):
    # works
    mo.icon('lucide:leaf', color="red")
    return


@app.cell
def _(mo):
    # does not work
    mo.md(f"# {mo.icon('lucide:leaf', color='red')}")
    return


@app.cell
def _(mo):
    btn = mo.ui.button(
        label=f"{mo.icon('lucide:rocket')} Submit",
    )
    return (btn,)


@app.cell
def _(btn):
    # not icon on button
    btn
    return


if __name__ == "__main__":
    app.run()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions