generated from wesen/wesen-go-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# UI DSL Schema | ||
# Each component has common attributes: | ||
# - id: unique identifier (optional) | ||
# - style: inline CSS (optional) | ||
# - disabled: boolean (optional) | ||
# - data: map of data attributes (optional) | ||
|
||
# Example components: | ||
--- | ||
button: | ||
text: Click me | ||
type: primary # primary, secondary, danger, success | ||
id: submit-btn | ||
disabled: false | ||
onclick: alert('clicked') | ||
|
||
title: | ||
content: Welcome to My App | ||
id: main-title | ||
|
||
text: | ||
content: This is a paragraph of text that explains something. | ||
id: description | ||
|
||
input: | ||
type: text # text, email, password, number, tel | ||
placeholder: Enter your name | ||
value: "" | ||
required: true | ||
id: name-input | ||
data: | ||
validate: true | ||
maxlength: 50 | ||
|
||
textarea: | ||
placeholder: Enter description | ||
rows: 4 | ||
cols: 50 | ||
value: | | ||
Default multiline | ||
text content | ||
checkbox: | ||
label: Accept terms | ||
checked: false | ||
required: true | ||
name: terms | ||
id: terms-checkbox | ||
|
||
list: | ||
type: ul # ul or ol | ||
items: | ||
- First item | ||
- Second item | ||
- Third item with: | ||
button: | ||
text: Click me | ||
type: secondary | ||
|
||
# Complex example with nested components | ||
form: | ||
id: signup-form | ||
components: | ||
- title: | ||
content: Sign Up | ||
- text: | ||
content: Please fill in your details below. | ||
- input: | ||
type: email | ||
placeholder: Email address | ||
required: true | ||
- input: | ||
type: password | ||
placeholder: Password | ||
required: true | ||
- checkbox: | ||
label: Subscribe to newsletter | ||
- button: | ||
text: Submit | ||
type: primary |