Basic functionality
This commit is contained in:
20
views/components/form.templ
Normal file
20
views/components/form.templ
Normal file
@ -0,0 +1,20 @@
|
||||
package components
|
||||
|
||||
type FormProps struct {
|
||||
Title string
|
||||
Method string
|
||||
Action string
|
||||
SubmitText string
|
||||
}
|
||||
|
||||
templ Form(props FormProps) {
|
||||
<div class="w-full mx-auto max-w-96 p-4 bg-white border border-gray-200 rounded-lg shadow dark:bg-gray-800 dark:border-gray-700">
|
||||
<form class="space-y-6" action={ templ.SafeURL(props.Action) } method={ props.Method }>
|
||||
<h5 class="text-xl font-medium text-gray-900 dark:text-white">{ props.Title }</h5>
|
||||
{ children... }
|
||||
@SubmitButton() {
|
||||
{ props.SubmitText }
|
||||
}
|
||||
</form>
|
||||
</div>
|
||||
}
|
||||
Reference in New Issue
Block a user