semvec/pypi-packages huggingface dataset:
instaui-mermaid 0.2.0
A Python package for generating mermaid diagrams in InstaUI.
Requires Python: <3.14,>=3.10
Keywords: gui, instaui, mermaid, ui, web

# instaui-mermaid

<div align="center">

English| [简体中文](./README.md)

</div>

## 📖 Introduction
instaui-mermaid is a Python package for generating mermaid diagrams in InstaUI. It is a part of the InstaUI project, which is a Python-based UI library for rapidly building user interfaces.


## 🚀Installation

```shell
pip install instaui-mermaid instaui[web]
```

```shell
uv add instaui-mermaid instaui[web] 
```

## 📚Usage

```python
from instaui_mermaid import Mermaid
from instaui import ui

@ui.page("/")
def index():
    graph = r"""
    graph TD
    a --> b
"""
    # ui
    Mermaid(graph)

ui.server(debug=True).run()
```

Dynamic graph:

```python
from instaui_mermaid import Mermaid
from instaui import ui, html


@ui.page("/")
def index():
    themes = ["default", "neutral", "dark", "forest", "base"]
    theme = ui.state(themes[0])

    graph = ui.str_format(
        r"""
---
config:
  theme: {theme}
---
    graph TD
    a --> b
""",
        theme=theme,
    )

    # ui
    html.select.from_list(themes, value = theme)
    Mermaid(graph)

ui.server(debug=True).run()
```