Help us shape the future of Go! Take the 2026 Go Developer Survey

karty-ui

module
v0.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: MIT

README

KartUI

Typed, declarative game interfaces for Karty.

KartUI combines markup, Go expressions, reusable components, and styles to make game menus and HUDs easy to author.

A main-menu.kui file declares a component with typed inputs and Go callbacks:

<template>
    <panel modal="true">
        <label class="title">{ props.Title }</label>
        <button onClick={ props.Play }>Play</button>
    </panel>
</template>

<script setup lang="go">
type MainMenuProps struct {
    Title string
    Play func()
}

func setup(props MainMenuProps) {}
</script>

<style>
.title
  font-size: theme.typography.title
</style>

The file name supplies the component name MainMenu; the Go setup parameters define its inputs. props.Title supplies the label text, and props.Play runs when the button is activated. Setup logic runs once per mounted instance; the script and style blocks are optional.

  • Compiler for components, layouts, themes, and styles.
  • Schema for bounded UI definitions shared with the runtime.
  • Go adapters for typed bindings and callbacks.
  • VS Code extension for context-aware completion, hover help, local style navigation, highlighting and snippets.

KartUI uses .kui single-file components with indented styles. See the SFC sample for setup logic, a reusable layout, and styles. The CLI discovers, stages and packages .kui components and layouts.

This public repository builds independently of the private Karty Engine. Rendering and platform input belong to the engine.

mise run test
mise run install-editor
mise run package-editor

Language reference · Styles · Development · Releases

Use KartUI in games with the Karty CLI.

Contributing · MIT license

Directories

Path Synopsis
Package codegen emits project-specific Go adapters for Karty UI and assets.
Package codegen emits project-specific Go adapters for Karty UI and assets.
Package uicompiler lowers KartUI UI sources into presentation assets and typed client bindings.
Package uicompiler lowers KartUI UI sources into presentation assets and typed client bindings.
internal
uibinarygen command
uibinarygen generates typed KUI1 field operations.
uibinarygen generates typed KUI1 field operations.
samples
sfc-demo command
Command sfc-demo compiles the sample component and prints its generated Go.
Command sfc-demo compiles the sample component and prints its generated Go.
Code generated by internal/uibinarygen; DO NOT EDIT.
Code generated by internal/uibinarygen; DO NOT EDIT.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL