Skip to content

12errh/Zolt

Repository files navigation

Zolt

Write Python. Render anywhere.
Web · Desktop · Terminal — from a single Python codebase.

PyPI Python License: MIT Tests

Zolt is a production-ready Python UI framework. Write your entire UI in pure Python — no HTML, no CSS, no JavaScript. One codebase compiles to a web app, a native desktop window, and a terminal UI.


Install

pip install zolt

Requires Python 3.10+.


Quick start

zolt new my-app
cd my-app
zolt run          # → http://localhost:8000

Or scaffold a dashboard:

zolt new my-dash --template dashboard
cd my-dash
zolt run

Hello World

from pyui import App, Button, Flex, Heading, Page, Text, reactive

class HomePage(Page):
    title = "Home"
    route = "/"

    def compose(self):
        with Flex(direction="col", align="center", gap=6):
            Heading("Hello from Zolt", level=1)
            Text("Built with pure Python.").style("muted")
            Button("Get Started").style("primary").size("lg")

class MyApp(App):
    name = "My App"
    home = HomePage()

Run it:

zolt run app.py                    # web browser
zolt run app.py --target desktop   # native window
zolt run app.py --target cli       # terminal

Reactive state

from pyui import App, Button, Flex, Page, Text, reactive

_count = reactive(0)

class CounterPage(Page):
    title = "Counter"
    route = "/"

    def compose(self):
        with Flex(direction="col", align="center", gap=4):
            Text(lambda: f"Count: {_count.get()}").style("lead")
            with Flex(gap=3):
                Button("−").style("ghost").onClick(lambda: _count.set(_count.get() - 1))
                Button("+").style("primary").onClick(lambda: _count.set(_count.get() + 1))

class CounterApp(App):
    count = _count
    home = CounterPage()

42+ built-in components

Category Components
Layout Flex, Grid, Stack, Container, Sidebar, Split, Divider, Spacer, List
Display Text, Heading, Badge, Tag, Avatar, Icon, Image, Markdown, Video
Input Button, Input, Textarea, Select, Checkbox, Radio, Toggle, Slider, DatePicker, FilePicker, Form
Feedback Alert, Toast, Modal, Drawer, Tooltip, Progress, Spinner, Skeleton
Navigation Nav, Tabs, Breadcrumb, Pagination, Menu
Data Table, Stat, Chart

6 built-in themes

class MyApp(App):
    theme = "dark"   # light · dark · ocean · sunset · forest · rose

Custom theme:

class MyApp(App):
    theme = {"color.primary": "#FF6B6B", "color.background": "#FFF5F5"}

CLI reference

Command Description
zolt new <name> Scaffold a new project (--template blank|dashboard|landing|admin|auth)
zolt run [app.py] Start dev server with hot reload (--target web|desktop|cli)
zolt build [app.py] Production build (--target web|desktop|cli|all)
zolt storybook Open component gallery
zolt doctor Check environment health
zolt lint [app.py] Lint component definitions
zolt search <query> Search PyPI for zolt-* packages
zolt publish Publish a component package to PyPI
zolt info Show version info

Plugin system

from pyui.plugins import PyUIPlugin, register_component

class ChartsPlugin(PyUIPlugin):
    name = "zolt-charts"
    version = "1.0.0"

    def on_load(self, app):
        register_component("LineChart", LineChartComponent)

class MyApp(App):
    plugins = [ChartsPlugin()]

Example apps

Five full example apps are in examples/:

App Description
dashboard/ Analytics dashboard with stats, chart, table
todo/ Reactive todo list
blog/ Content site with routing
ml-demo/ ML inference UI
admin/ CRUD admin panel

Run any example:

zolt run examples/dashboard/app.py

What's included

  • ✅ Web renderer (HTML + Tailwind CSS + Alpine.js)
  • ✅ Desktop renderer (tkinter, optional sv-ttk)
  • ✅ CLI renderer (Rich TUI)
  • ✅ Reactive state (reactive, computed, store)
  • ✅ Theme engine (6 built-in themes + custom tokens + Figma export)
  • ✅ Plugin system with lifecycle hooks
  • ✅ Hot reload (file save → browser update)
  • ✅ Dev tools panel (state inspector, event log)
  • ✅ Error overlay with structured error codes (PYUI-NNN)
  • zolt lint — component tree validation
  • zolt doctor — environment health check
  • zolt publish — marketplace publishing via PyPI

Contributing

See CONTRIBUTING.md. Issues labelled good-first-issue are a great place to start.

License

MIT — see LICENSE.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages