Skip to content

Zomatree/Kine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kine

Logo and name

Kine is a web-based gui framework with support for reactive code and ease of use.

Supports both liveview-style server-side rendering and running client side via WASM.

Example

See a version of this example running live here

import asyncio

from kine import *
from kine.renderers.web import *

@component
def app(cx: Scope):
    value = use_state(cx, lambda: 0)

    return div[
        button(
            onclick=lambda _: value.modify(lambda v: v + 1)
        )[
            "+1"
        ],
        f"{value.get()}",
        button(
            onclick=lambda _: value.modify(lambda v: v - 1)
        )[
            "-1"
        ],
    ]

asyncio.run(start_web(app()))