Skip to content

Rhyme syntax overview

Rhyme is the language you use to build Rhappsody apps. It’s a declarative, action-based language: a Rhyme file is a sequence of actions that run top to bottom, building up a UI and responding to data and input as they go.

The three action types

Every action in Rhyme is one of three kinds:

Element

Elements render UI components. They’re identified by a leading dot:

.text "Hello, world!"
.button "Submit"
.header "Welcome"
.divider
.image [cover-photo]

Elements appear in the display tree in the order you write them.

Function

Functions compute or retrieve a value. They’re plain names — no dot — and their result can be used in expressions or passed as an argument to other actions:

value [items]
format [price] "currency"
count [list]

Action

Actions trigger behavior: output, navigation, state changes, loops. Also plain names:

print [page-title]
log "debug message"
goto [confirmation-page]
remember name [input-value]
loop [items]

Arguments

Arguments follow the action name on the same line. Rhyme supports three argument forms:

String literals — double-quoted text:

.text "Hello!"
.button "Continue"

References — a name or path in square brackets that resolves at runtime:

.text [user.name]
goto [next-page]

References can point to variables, page names, data fields, or connected sheet values.

Bare identifiers — plain unquoted names, used where an action expects a label or variable name rather than a value:

remember name [input-value]

Here name is the identifier the value will be stored under — not a string literal, not a reference, just a name.

Slots

Some element actions accept named slots — sub-components that go inside the element. Slot actions use a leading comma and must appear before the element they belong to:

,text "Continue"
,link [checkout]
.wide-button

Here ,text and ,link fill slots on the .wide-button element. The same element without slots is a simpler one-liner:

.button "Continue"

Slots let you compose richer components without a nested syntax.

Action catalog

The full list of available actions — with descriptions, all pattern forms, and examples — is in the action catalog. Actions are grouped by the three types above: Elements, Functions, and Actions.