-keywords
Keywords in Rhyme use a dash (-) prefix to customize the behavior of actions. They act as modifiers that change how an action displays or behaves.
how keyword tags work
Keywords are added after actions to modify their appearance or behavior. You can use multiple keywords on a single line, and the order doesn’t matter:
.text "Hello" -bold -underline
.text "Important!" -bold -red -large
.button "Submit" -primary -disabled
common keywords
Keywords provide quick ways to style and control elements without complex syntax:
text styling
-bold
- Makes text bold-italic
- Makes text italic-underline
- Underlines text-strike
- Strikethrough text
size modifiers
-small
- Smaller than normal-large
- Larger than normal-huge
- Extra large
alignment
-left
- Align to the left-center
- Center alignment-right
- Align to the right
state modifiers
-disabled
- Disables interaction-hidden
- Hides the element-required
- Marks as required
combining keywords
The real power comes from combining multiple keywords:
// A centered, bold title
.text "Welcome!" -bold -large -center
// A disabled secondary button
.button "Not Available" -secondary -disabled
// An important error message
.text "Error: Invalid input" -red -bold -underline
Keywords make your code more readable by clearly showing the intent. Instead of complex styling code, you simply add descriptive modifiers.
coming soon
More documentation will cover:
- Complete list of available keywords
- Action-specific keywords
- Creating custom keywords
- Performance considerations
Check back soon for comprehensive keyword documentation.