Skip to content

rayquiro.app

This content is for v1.0. Switch to the latest version for up-to-date documentation.

The rayquiro.app module serves as the HTML/DOM structure layer of RayQuiro. Just as HTML provides semantic structure and elements (<button>, <input>, <div>) while CSS styles them, rayquiro.app creates and organizes UI element objects, while rayquiro.ui provides styling.

import "rayquiro.app";
import "rayquiro.ui";

┌────────────────────────────────────────────────────────┐
│ RayQuiro Interface │
├──────────────────────────┬─────────────────────────────┤
│ rayquiro.app │ rayquiro.ui │
│ (HTML Elements) │ (CSS & Styling) │
├──────────────────────────┼─────────────────────────────┤
│ • Button, Text, Input │ • Color palettes & themes │
│ • Checkbox, Radio │ • CSS rules & inline styles │
│ • Slider, Progress, Select│ • Margins, paddings, borders│
│ • Row, Column, Box, Card │ • Minimal default styles │
│ • Window & Event Loop │ • ui.apply(element, style) │
└──────────────────────────┴─────────────────────────────┘

All element constructors return a clean, structured Element object.

ElementSignatureDescription
Buttonapp.button(text, options)Interactive push button (<button>).
Textapp.text(text, options)Inline text label (<span> / <label>).
Inputapp.input(placeholder, value, options)Single-line text input field (<input>).
Textareaapp.textarea(placeholder, value, options)Multi-line text area (<textarea>).
Checkboxapp.checkbox(label, checked, options)Toggle checkbox (<input type="checkbox">).
Radioapp.radio(label, group, checked, options)Radio selection button (<input type="radio">).
Sliderapp.slider(min, max, value, options)Numeric range slider (<input type="range">).
Progressapp.progress(value, max, options)Progress status bar (<progress>).
Selectapp.select(optionsArray, selectedIndex, options)Dropdown select menu (<select>).
Imageapp.image(src, options)Image element (<img>).
Linkapp.link(url, text, options)Hyperlink anchor (<a href="...">).
Headingapp.heading(text, level, options)Title heading <h1> - <h6>.
Dividerapp.divider(options)Horizontal rule separator (<hr />).
Rowapp.row(children, options)Horizontal flexbox layout (display: flex; flex-direction: row).
Columnapp.column(children, options)Vertical flexbox layout (display: flex; flex-direction: column).
Box / Cardapp.box(children, options)Container card/box (<div>).
Genericapp.element(tag, props, children, style)Generic custom DOM element constructor.
To HTMLapp.to_html(element)Serializes element tree directly to valid HTML string.

Elements can be created with clean, minimal default styles and composed into hierarchies:

import "rayquiro.app";
import "rayquiro.ui";
var title = app.heading("Вход в систему", 2);
var loginInput = app.input("Имя пользователя...");
var passInput = app.input("Пароль...");
var remember = app.checkbox("Запомнить меня", true);
var submitBtn = app.button("Войти", { "id": "btn_login" });
submitBtn = ui.apply(submitBtn, {
"background": "#2563eb",
"color": "#ffffff",
"radius": 6,
"padding": "8px 16px"
});
var formCard = app.card([
title,
app.divider(),
loginInput,
passInput,
remember,
submitBtn
]);
var htmlCode = app.to_html(formCard);
print(htmlCode);

The app module launches native desktop applications, opens OS windows, and manages native controls, while ui configures styling (backgrounds, fonts, colors, and CSS rules):

import "rayquiro.app";
import "rayquiro.ui";
app.init("My Desktop App", 480, 340);
ui.style("background: #18181b; color: #f4f4f5; font-size: 14;");
app.text("Welcome to RayQuiro Desktop Application!");
app.input("Enter your command...");
app.checkbox("Start automatically with OS", true);
app.button("Launch");
app.run();
FunctionDescription
app.init(title, width, height)Creates and displays an application window.
app.run()Starts the OS message/event loop.
app.button(text, x, y, w, h)Adds a button control (auto-positioned if coordinates are omitted).
app.text(text, x, y, w, h)Adds a text label control.
app.input(placeholder, x, y, w, h)Adds a single-line text input control.
app.checkbox(label, checked, x, y, w, h)Adds a toggle checkbox control.
app.msg(title, text)Displays a native modal message dialog box.
app.quit() / app.close()Closes the window and terminates the app.