xtablo-source/backend/internal/web/ui/input.templ

31 lines
522 B
Text
Raw Permalink Normal View History

package ui
type InputProps struct {
ID string
Name string
Value string
Placeholder string
Type string
Disabled bool
Required bool
Attrs templ.Attributes
}
templ Input(props InputProps) {
<input
id={ inputID(props.ID, props.Name) }
type={ inputType(props.Type) }
name={ props.Name }
value={ props.Value }
placeholder={ props.Placeholder }
class="ui-input"
if props.Disabled {
disabled
}
if props.Required {
required
}
{ props.Attrs... }
/>
}