Files
hemx/examples/v0/templates/todos.heml
T
slhx agent d4e865ef92 feat(api): streamline generated app authoring
Move the canonical examples toward generated component-root helpers, typed form decoding, async/state handler registration, and derive-driven app/component registry wiring. Tighten requirements and diagnostics for the server-first, selectorless authoring path.

Verified with cargo run -p slhx-xtask -- test, cargo check --workspace, redgate list, redgate refs, redgate health --strict, and git diff --check.

req: canonical/001

req: canonical/003

req: canonical/004

req: dx/002

req: derive_app/001

req: component/003

req: form/004

req: axum_integration/003
2026-06-05 06:33:41 +02:00

24 lines
889 B
Plaintext

<section data-slhx-root="todos">
<form data-slhx-handle="add_todo" data-slhx-form="new_todo">
<input name="title" required="required">
<button type="submit">Add</button>
</form>
<p data-slhx-slot="summary">{+ self.summary +}</p>
<div data-slhx-slot="todo_list">
<ul data-slhx-slot="todo_row">
<template h-for="todo in &self.items" h-key="todo.id">
<li data-slhx-slot="todo_row" +data-key="todo.id">
<span>{+ todo.title +}</span>
<form data-slhx-handle="rename_todo">
<input type="hidden" name="id" +value="todo.id">
<button type="submit" name="title" value="Renamed todo">Rename</button>
</form>
<form data-slhx-handle="delete_todo">
<button type="submit" name="id" +value="todo.id">Delete</button>
</form>
</li>
</template>
</ul>
</div>
</section>