Create custom user interfaces, alerts, dialogs, and file pickers*
The hs.ui module provides a set of tools for creating custom user interfaces
in Hammerspoon with SwiftUI-like declarative syntax.
Key Features
then call .replaceWithColor() or .replaceWithHex() on it from any callback to re-render the canvas automatically
then call .set() on it to update the displayed content live
to swap the image without rebuilding the window
hs.ui
Create custom user interfaces, alerts, dialogs, and file pickers* The
hs.uimodule provides a set of tools for creating custom user interfaces in Hammerspoon with SwiftUI-like declarative syntax.Key Features
then call
.replaceWithColor()or.replaceWithHex()on it from any callback to re-render the canvas automatically then call.set()on it to update the displayed content live to swap the image without rebuilding the windowBasic Examples
Simple Alert
Dialog with Buttons
Text Input Prompt
File Picker
Custom Window
Reactive Color on Hover
Reactive Text on Hover
Reactive Image on Click
Complete Example: Status Dashboard
Here's a more complex example showing how to build an interactive status dashboard
Complete Example: Reactive Hover Card
Demonstrates reactive colors and reactive text together — a single
.onHover()