go-cook-portal/views/components/bootstrap/switch.templ

14 lines
363 B
Plaintext

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