Skip to content

Gnim

Library that brings JSX, reactivity and type-safety to GNOME JavaScript.

Get started

sh
npm create gnim@alpha
sh
pnpm create gnim@alpha
sh
yarn create gnim@alpha
sh
bun create gnim@alpha
sh
deno init --npm gnim@alpha

Obligatory 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>
  )
}