Introduction
CryKit builds desktop applications with Crystal and HTML/ECR templates. Keep application state and event handlers in Crystal, describe the interface with HTML, and style it with CSS. Reactive values update the interface through a native webview. Application development does not require Node.js or a separate frontend build.
Applications currently run on macOS. CryKit requires native resource loading, which the Linux and Windows backends do not yet provide.
Quick lookup
| Looking for | Go to |
|---|---|
| Generate a new app | crykit init or Getting started |
| CLI commands and flags | Command reference |
| Application methods and configuration | Application API |
| Native manager APIs | Reference index |
| Window controls and events | Windows |
| Dialogs, menus, trays and system | Dialogs · Menus · Trays · System |
How an application fits together
An application owns routes, windows, assets, shared models, and native capabilities. A route selects the view to mount for a local path. A view owns interface state and callbacks, and its template declares the HTML that reads that state. An optional layout supplies the surrounding document.
The initial template is constructed once. When a reactive value changes, CryKit updates the bindings and regions that read it. Menus, dialogs, system access, and trays are exposed through the application's capability managers.
Start building
- Follow Getting started to run a minimal counter.
- Learn Views and composition and Compiled templates to add state, forms, and reusable interface pieces.
- Configure Application routes and assets, then add Background jobs for work outside the UI context.
- Add native windows, dialogs, menus, trays, or system access as needed.
- Test your application, then distribute it.
The example applications show these pieces working together. The CLI reference lists init, dev, build, dist, and their options.
Framework development
Start with Contributing to work on CryKit itself. For a deeper understanding, read Architecture and How it works, then the Rendering and Runtime protocol contracts.
Vocabulary
| Term | Meaning |
|---|---|
| View | A Crystal object including CryKit::View, with state and a template declaration |
| Layout | A Crystal object including CryKit::Layout, rendering the document shell once and yielding the mounted fragment |
| Mount | One retained rendering of a view, with node identities and an update lifecycle |
| Template | Compiled HTML with retained readers, callbacks and region factories |
| Document | A loaded page and its mounted views; navigation replaces it |