Desktop & Mobile
NAIDE can generate desktop and mobile applications from simple declarative syntax.
Desktop Apps
The desktop keyword creates a native desktop window that loads a web page:
desktop myApp:
title "My Desktop App"
size 1024 768
load "index.html"
Syntax
desktop name:
title "Window Title" # Window title
size width height # Window dimensions
load "file.html" # HTML file to load
Combine with Page
Generate the HTML and load it in a desktop window:
page "app.html":
title "My App"
style "styles.css"
div "app":
h1 "Hello Desktop"
p "Running natively!"
desktop myApp:
title "My App"
size 800 600
load "app.html"
Multi-Target
| Target | Framework | Install |
|---|---|---|
| Node.js / Bun | Electron | npm install electron |
| Python | pywebview | pip install pywebview |
Mobile Screens
The screen keyword defines a mobile app screen with UI elements:
screen Home:
text "Hello World"
button "Click Me"
input "Enter your name"
image "logo.png"
Supported Elements
| Element | Node.js (React Native) | Python (Kivy) |
|---|---|---|
text "..." |
<Text> |
Label |
button "..." |
<TouchableOpacity> |
Button |
input "..." |
<TextInput> |
TextInput |
image "..." |
<Image> |
- |
Button with Action
Buttons can have a body block for tap handlers:
screen Settings:
text "Settings"
button "Save":
log "Saved!"
button "Reset":
log "Reset!"
Multi-Target
| Target | Framework | Install |
|---|---|---|
| Node.js / Bun | React Native | npx react-native init |
| Python | Kivy | pip install kivy |