Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 774 Bytes

README.md

File metadata and controls

39 lines (28 loc) · 774 Bytes

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()))