dreamstack/examples/form.ds
enzotar a35d44bd59 feat: two-way binding, form props, and async resources
Phase 8 features:
- bind prop: two-way signal <-> input sync
- placeholder, value, style, disabled props
- DS.resource() for reactive async data fetching
- DS.fetchJSON() convenience wrapper
- Props-only element parsing: input { bind: x }
- examples/form.ds: contact form with validation

Fixed: double .value.value bug in bind codegen.
2026-02-25 08:08:37 -08:00

28 lines
557 B
Text

-- DreamStack Form Example
-- Two-way binding, validation, and reactive form state
let name = ""
let email = ""
let message = ""
let submitted = false
let char_count = 0
view main = column [
text "Contact Form"
text "Name"
input { bind: name, placeholder: "Your name" }
text "Email"
input { bind: email, placeholder: "you@example.com" }
text "Message"
input { bind: message, placeholder: "Type your message..." }
text char_count
button "Submit" { click: submitted = true }
when submitted ->
text "Thanks for your message!"
]