OCaml-stk is a Graphical User Interfce toolkit for OCaml based on libSDL 2, through the Tsdl bindings.

Lwt is used to provide pseudo-parallelism in event handling.

Stk is still in development but already provides various widgets.

The Stk_iconv library provides bindings to GNU libiconv, to convert strings to and from UTF-8, which is the format of strings in OCaml-stk.


Library reference documentation:

The file test/example.ml in the repository shows a minimal application (just a window). Other test programs in examples/ and test/ directories provide some examples of widgets.


Development is hosted on Framagit.

OCaml-STK is released under GPL3 license.

Stk is used in Chamo.


The stk and stk_iconv packages are installable with opam:

opam install stk stk_iconv

Current state of OCaml-stk can be installed with:

$ opam pin add stk https://framagit.org/zoggy/ocaml-stk.git
$ opam pin add stk_iconv https://framagit.org/zoggy/ocaml-stk.git

For current state, you should also pin Tsdl package because a not-yet released fix is required by stk:

$ opam pin add tsdl https://github.com/dbuenzli/tsdl.git

Author and contact

Maxence Guesdon <Maxence ‘DOT’ Guesdon ‘AT’ inria ‘DOT’ fr>