Metadata-Version: 2.4
Name: mikiui
Version: 0.0.1
Summary: Python-first UI framework that renders UIs as standalone desktops or websites.
Requires-Python: >=3.14
Description-Content-Type: text/markdown
Requires-Dist: fastapi>=0.115
Requires-Dist: uvicorn[standard]>=0.30
Requires-Dist: click>=8.1
Requires-Dist: typer>=0.12
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov>=6.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.24; extra == "dev"
Requires-Dist: mypy>=1.13; extra == "dev"
Requires-Dist: ruff>=0.8; extra == "dev"
Requires-Dist: httpx>=0.28; extra == "dev"
Requires-Dist: playwright>=1.40; extra == "dev"
Provides-Extra: build
Requires-Dist: setuptools>=68; extra == "build"
Requires-Dist: wheel>=0.42; extra == "build"
Requires-Dist: build>=1.2; extra == "build"
Provides-Extra: desktop
Requires-Dist: pywebview>=5.0; extra == "desktop"
Requires-Dist: pyinstaller>=6.0; extra == "desktop"
Requires-Dist: watchfiles>=0.21; extra == "desktop"
Provides-Extra: tailwind
Requires-Dist: watchfiles>=0.21; extra == "tailwind"

# MikiUI

A Python-first UI framework that renders UIs as standalone desktops or websites.

## Quick Start

```bash
pip install -e .
mikiui new myapp
cd myapp
mikiui dev           # development server
# or
mikiui desktop        # native desktop window
```

## Styling

MikiUI supports two styling frameworks. Choose one during project creation:

```bash
mikiui new myapp
# Follow the prompts to choose Tailwind or plain CSS
```

| Framework | Description | Node.js Required |
|-----------|-------------|-----------------|
| `tailwind` | Tailwind CSS + optional DaisyUI | Yes |
| `plain` | Plain CSS, no framework | No |

### Tailwind CSS

```bash
cd myapp
npm install          # Install Node.js dependencies
mikiui dev           # Start dev server
mikiui tailwind dev  # Watch & rebuild CSS (second terminal)
```

Production build:

```bash
mikiui build --target web --theme tailwind
```

Add DaisyUI:

```bash
mikiui install tailwind daisyui
```

### Plain CSS

```bash
cd myapp
mikiui dev           # No extra setup needed
```

## What's Available

- **Components** — all HTML elements as Python classes (Button, Input, Form, Table, Dialog, Tabs, etc.)
- **Widgets** — high-level composite UI (DataGrid, MediaPlayer, DockablePanel, IDE Editor, ThemeSwitcher, etc.)
- **Themes** — 4 built-in themes (light, dark, solarized-dark, dracula) with custom theme support
- **Styling** — Tailwind CSS or plain CSS
- **Plugins** — extend with custom themes, components, and widgets
- **Desktop** — native pywebview window or system browser fallback
- **Full-stack** — FastAPI backend with HTMX + Alpine.js runtime

## Commands

| Command | Description |
|---------|-------------|
| `mikiui new <name>` | Scaffold a new project (prompts for framework) |
| `mikiui dev` | Development server (auto-discovers `app.py`) |
| `mikiui desktop` | Native desktop window (pywebview) |
| `mikiui desktop --reload` | Desktop with auto-reload |
| `mikiui desktop --browser` | Force system browser |
| `mikiui build --target web` | Static web build |
| `mikiui build --target desktop` | Desktop package build |
| `mikiui tailwind dev` | Watch and rebuild Tailwind CSS |
| `mikiui tailwind build` | Production Tailwind build |
| `mikiui install tailwind` | Install Tailwind + npm deps |

## Running Your App

```python
# app.py
from mikiui import MikiApp, Div, H1, Button

app = MikiApp(title="My App")
app.set_theme("dark")

@app.route("/", title="Home")
def home():
    return Div(H1("Welcome to MikiUI!"), Button("Click me"))

if __name__ == "__main__":
    app.run()       # python app.py
    # or: app.run(desktop=True)  for native window
```

## Documentation

- [Getting Started](docs/getting-started.md)
- [Styling Guide](docs/styling.md)
- [Theme Reference](docs/theme-reference.md)
- [Theming Guide](docs/themes.md)
- [App Discovery & Running](docs/app-discovery.md)
- [Plugin System](docs/plugins.md)
- [Full Spec](context/plan.md)

## Production readiness

Use the following commands to validate the package and production build flow before shipping a release:

```bash
pip install -e .
python -m build
mikiui build --target web
mikiui build --target desktop
pytest
```

The framework is intended to support:

- web deployment via static HTML/HTMX + FastAPI
- desktop deployment via pywebview or browser fallback
- a single Python codebase for component and widget reuse
- Tailwind or plain CSS styling without changing app logic

## License

MIT
