Gnim
A library that brings JSX, reactivity, and type safety to GNOME JavaScript.
- TypeScript support for generating GObject Introspection type annotations
- JSX and reactivity for both Gtk applications and GNOME extensions
- GObject decorators as a convenient way to subclass GObjects
- DBus decorators for implementing DBus services and proxies
Get started
sh
npm create gnim@alphash
pnpm create gnim@alphash
yarn create gnim@alphash
bun create gnim@alphash
deno init --npm gnim@alphaObligatory Counter Example
tsx
function Counter() {
const [count, setCount] = createState(0)
function increment() {
setCount((v) => v + 1)
}
effect(() => {
console.log("count is", count())
})
return (
<Gtk.Box spacing={8}>
<Gtk.Label label={count.as(String)} />
<Gtk.Button onClicked={increment}>Increment</Gtk.Button>
</Gtk.Box>
)
}