{"id":52010787,"url":"https://github.com/webui-dev/elixir-webui","last_synced_at":"2026-07-31T19:30:31.430Z","repository":{"id":371903997,"uuid":"1303990186","full_name":"webui-dev/elixir-webui","owner":"webui-dev","description":"Use any web browser or WebView as GUI, with Elixir in the backend and modern web technologies in the frontend, all in a lightweight portable library.","archived":false,"fork":false,"pushed_at":"2026-07-17T16:10:32.000Z","size":75,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-17T17:29:38.858Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webui-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-07-17T12:50:36.000Z","updated_at":"2026-07-17T16:11:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/webui-dev/elixir-webui","commit_stats":null,"previous_names":["webui-dev/elixir-webui"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/webui-dev/elixir-webui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webui-dev%2Felixir-webui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webui-dev%2Felixir-webui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webui-dev%2Felixir-webui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webui-dev%2Felixir-webui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webui-dev","download_url":"https://codeload.github.com/webui-dev/elixir-webui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webui-dev%2Felixir-webui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36131433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-31T02:00:06.731Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-31T19:30:27.864Z","updated_at":"2026-07-31T19:30:31.414Z","avatar_url":"https://github.com/webui-dev.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elixir WebUI v2.5.1\n\nUse any web browser or WebView as GUI, with Elixir in the backend and modern web technologies in the frontend, all in a lightweight portable library.\n\n\u003e [!NOTE]\n\u003e This binding is under development and has not yet been published to Hex.\n\n![Screenshot](https://raw.githubusercontent.com/webui-dev/webui-logo/main/screenshot.png)\n\n## Why\n\n[WebUI](https://webui.me) drives a browser you already have installed instead of\nbundling a browser engine, so applications stay small and portable. Your UI is\nHTML/CSS/JS; your backend is Elixir.\n\n## Install\n\nUnlike the other WebUI bindings, this one compiles a small C shim, so a C\ncompiler is required. Erlang has no runtime FFI, so there is no way to call\nWebUI without one.\n\n| Platform | Needs |\n|---|---|\n| Linux | `gcc`, `make` |\n| macOS | Xcode command line tools |\n| Windows | MSVC — see the note below |\n\nOne command fetches Elixir deps, downloads the WebUI static library for your\nplatform, and builds the NIF:\n\n```sh\nmix setup\n```\n\n\u003e [!IMPORTANT]\n\u003e **On Windows, run this from a Developer Command Prompt for VS** (or a shell\n\u003e where you have run `vcvarsall.bat`). The build uses `nmake` and `cl`, which\n\u003e are only on `PATH` there. From an ordinary prompt it fails with:\n\u003e ```\n\u003e ** (Mix) \"nmake\" not found in the path.\n\u003e ```\n\nPrefer the steps individually, or already have the deps? They are:\n\n```sh\nbash bootstrap.sh      # Linux / macOS   (bootstrap.bat on Windows)\nmix deps.get\nmix compile\n```\n\nWebUI is linked **statically** into the NIF, so there is no `webui-2.dll` /\n`libwebui-2.so` to ship or locate at runtime — `priv/webui_nif.*` is\nself-contained.\n\nTo build against a local WebUI checkout instead of the released library:\n\n```sh\nWEBUI_DIR=/path/to/webui/dist WEBUI_INCLUDE=/path/to/webui/include mix compile\n```\n\n## Minimal example\n\n```elixir\nwin = WebUI.new_window()\nWebUI.show(win, ~S(\u003chtml\u003e\u003cscript src=\"webui.js\"\u003e\u003c/script\u003e Hello World! \u003c/html\u003e))\nWebUI.wait()\nWebUI.clean()\n```\n\nEvery page must load `\u003cscript src=\"webui.js\"\u003e\u003c/script\u003e`. WebUI generates that\nfile in memory — you do not create it.\n\n## Calling Elixir from JavaScript\n\nBound functions appear in the page as async JS functions of the same name. The\nhandler's return value resolves the Promise.\n\n```elixir\nwin = WebUI.new_window()\n\nWebUI.bind(win, \"add\", fn e -\u003e\n  WebUI.Event.get_int(e, 0) + WebUI.Event.get_int(e, 1)\nend)\n\nWebUI.show(win, ~S\"\"\"\n\u003chtml\u003e\n  \u003cscript src=\"webui.js\"\u003e\u003c/script\u003e\n  \u003cbutton onclick=\"add(2, 3).then(r =\u003e alert(r))\"\u003eAdd\u003c/button\u003e\n\u003c/html\u003e\n\"\"\")\n\nWebUI.wait()\n```\n\nResponses cross to JavaScript as strings. Numbers, booleans and atoms are\nconverted for you; `nil` and `:ok` become `\"\"`. Return structured data by\nencoding it yourself:\n\n```elixir\nWebUI.bind(win, \"load_user\", fn e -\u003e\n  e |\u003e WebUI.Event.get_int(0) |\u003e Users.get!() |\u003e Jason.encode!()\nend)\n```\n\n## Calling JavaScript from Elixir\n\n```elixir\nWebUI.run(win, \"document.title = 'Set from Elixir'\")   # fire and forget\n{:ok, \"42\"} = WebUI.script(win, \"return 6 * 7;\")       # wait for a result\n```\n\n`script/3` takes `:timeout` (seconds, `0` waits forever) and `:buffer_size`\n(bytes, default `8192` — longer results are truncated).\n\n## Catching every event\n\nBinding an empty element name catches all events on the window:\n\n```elixir\nWebUI.bind(win, \"\", fn\n  %WebUI.Event{type: :connected} -\u003e IO.puts(\"connected\")\n  %WebUI.Event{type: :disconnected} -\u003e IO.puts(\"disconnected\")\n  %WebUI.Event{type: :navigation} = e -\u003e IO.puts(\"going to #{WebUI.Event.get_string(e, 0)}\")\n  _ -\u003e :ok\nend)\n```\n\n## Examples\n\nSee [examples/](examples/).\n\n## API\n\nFull documentation lives in the module docs — start at `WebUI`. The API mirrors\nthe [C API](https://webui.me) with Elixir naming: `webui_show` → `WebUI.show/2`,\n`webui_set_size` → `WebUI.set_size/3`, predicates as `WebUI.shown?/1`.\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebui-dev%2Felixir-webui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebui-dev%2Felixir-webui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebui-dev%2Felixir-webui/lists"}