Initial commit
This commit is contained in:
17
cmd/web/hello.templ
Normal file
17
cmd/web/hello.templ
Normal file
@@ -0,0 +1,17 @@
|
||||
package web
|
||||
|
||||
templ HelloForm() {
|
||||
@Base() {
|
||||
<form hx-post="/hello" method="POST" hx-target="#hello-container">
|
||||
<input class="bg-gray-200 text-black p-2 border border-gray-400 rounded-lg"id="name" name="name" type="text"/>
|
||||
<button type="submit" class="bg-orange-500 hover:bg-orange-700 text-white py-2 px-4 rounded">Submit</button>
|
||||
</form>
|
||||
<div id="hello-container"></div>
|
||||
}
|
||||
}
|
||||
|
||||
templ HelloPost(name string) {
|
||||
<div class="bg-green-100 p-4 shadow-md rounded-lg mt-6">
|
||||
<p>Hello, { name }</p>
|
||||
</div>
|
||||
}
|
||||
Reference in New Issue
Block a user