t2/views/components/form.templ

20 lines
621 B
Plaintext

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>
}