cleaned up the current bootstrap components

This commit is contained in:
James Tombleson 2024-04-14 18:36:04 -07:00
parent 03d151f75a
commit 9d88d649d1
4 changed files with 28 additions and 4 deletions

View File

@ -17,7 +17,3 @@ templ BootstrapAlert(message, variant string) {
{ message }
</div>
}
templ BootstrapButton(message, variant string) {
<button type="button" class={ getButtonVariant(variant) }>{ message }</button>
}

View File

@ -0,0 +1,10 @@
package bootstrap
const (
ButtonTypeSubmit = "submit"
ButtonTypeDefault = "button"
)
templ BootstrapButton(message, variant, buttonType string) {
<button type={ buttonType } class={ getButtonVariant(variant) }>{ message }</button>
}

View File

@ -0,0 +1,5 @@
package bootstrap
templ Label(cssClass, name, cssForId, message string) {
<label class={ cssClass } name={ name } for={ cssForId }>{ message }</label>
}

View File

@ -0,0 +1,13 @@
package bootstrap
const (
SwitchTypeCheckbox = "checkbox"
)
templ Switch(name, switchType, cssId string, enabled bool) {
if enabled == true {
<input class="form-check-input" name={ name } type={ switchType } role="switch" id={ cssId } checked/>
} else {
<input class="form-check-input" name={ name } type={ switchType } role="switch" id={ cssId }/>
}
}