Otter
Snippets
Otter
Upstream Otter 1.0.1 Tested
Declarative UI Page Layout
Define a hierarchical declarative UI page structure with headings, cards, and buttons.
Architecture & Runtime Preview
Otter 1.0.1Zero-dependency Otter 1.0.1 snippet (User Interface). Copy the parameterized template or run the self-contained example.
- 1Category: User Interface
- 2Attribution: Otter Declarative UI Spec (D56)
- 3Zero external pack dependencies — paste directly into any .ot file
Source Code (2 files)
page "${pageTitle}"
heading "${headingText}"
card "${cardTitle}"
text "${bodyText}"
button "${buttonLabel}"
click
say "Clicked ${buttonLabel}"
primary button "Submit"
layoutDefined is false
page "User Management"
heading "All Users"
card "Directory"
text "Showing 25 active members"
button "Export CSV"
click
say "Exporting CSV..."
primary button "Add User"
layoutDefined is true
say "Page layout defined"
if layoutDefined is not true
fail with "page layout failed to define"
.
Installation & Usage
otter snippet inspect ui-page-layout
Copy template.ot directly into your .ot source file, or run example.ot with 'otter run example.ot'.