Documentation
¶
Index ¶
- Variables
- func Button(value string) *element
- func Checkbox(name string, value string) *element
- func Color(name string) *element
- func Date(name string) *element
- func DateTimeLocal(name string) *element
- func Email(name string) *element
- func File(name string) *element
- func Hidden(name string, value string) *element
- func Image(name string, src string) *element
- func Month(name string) *element
- func New() *element
- func Number(name string) *element
- func Password(name string) *element
- func Radio(name string, value string) *element
- func Range(name string) *element
- func Reset(value string) *element
- func Search(name string) *element
- func Submit(value string) *element
- func Tel(name string) *element
- func Text(name string, value string) *element
- func Time(name string) *element
- func URL(name string) *element
- func Week(name string) *element
- type Element
Constants ¶
This section is empty.
Variables ¶
var ( TagOpen = []byte("<input") AttrName = []byte(" name=\"") AttrValue = []byte(" value=\"") AttrType = []byte(" type=\"") AttrSrc = []byte(" src=\"") AttrAccept = []byte(" accept=\"") AttrAlt = []byte(" alt=\"") AttrAutoComplete = []byte(" autocomplete=\"") AttrCapture = []byte(" capture=\"") AttrChecked = []byte(" checked") AttrDirName = []byte(" dirname=\"") AttrDisabled = []byte(" disabled") AttrForm = []byte(" form=\"") AttrFormAction = []byte(" formaction=\"") AttrFormEncType = []byte(" formenctype=\"") AttrFormMethod = []byte(" formmethod=\"") AttrFormNoValidate = []byte(" formnovalidate") AttrFormTarget = []byte(" formtarget=\"") AttrHeight = []byte(" height=\"") AttrList = []byte(" list=\"") AttrMax = []byte(" max=\"") AttrMaxLength = []byte(" maxlength=\"") AttrMin = []byte(" min=\"") AttrMinLength = []byte(" minlength=\"") AttrMultiple = []byte(" multiple") AttrPattern = []byte(" pattern=\"") AttrPlaceholder = []byte(" placeholder=\"") AttrPopoverTarget = []byte(" popovertarget=\"") AttrPopoverTargetAction = []byte(" popovertargetaction=\"") AttrReadOnly = []byte(" readonly") AttrRequired = []byte(" required") AttrSize = []byte(" size=\"") AttrStep = []byte(" step=\"") AttrWidth = []byte(" width=\"") AttrAlpha = []byte(" alpha") AttrColorSpace = []byte(" colorspace=\"") )
Byte constants for HTML rendering.
Functions ¶
func Button ¶
func Button(value string) *element
Button Creates a button input with no default behaviour. Example: input.Button("Click Me") Renders: <input value="Click Me" type="button" />
func Checkbox ¶
Checkbox Creates a checkbox input for boolean or multi-select options. Example: input.Checkbox("agree", "yes") Renders: <input name="agree" value="yes" type="checkbox" />
func Color ¶
func Color(name string) *element
Color Creates a colour picker input field. Example: input.Color("theme") Renders: <input name="theme" type="color" />
func Date ¶
func Date(name string) *element
Date Creates a date picker input field. Example: input.Date("birthday") Renders: <input name="birthday" type="date" />
func DateTimeLocal ¶
func DateTimeLocal(name string) *element
DateTimeLocal Creates a local date and time picker input field. Example: input.DateTimeLocal("meeting") Renders: <input name="meeting" type="datetime-local" />
func Email ¶
func Email(name string) *element
Email Creates an email input field with automatic email validation. Example: input.Email("email") Renders: <input name="email" type="email" />
func File ¶
func File(name string) *element
File Creates a file upload input for selecting local files. Example: input.File("avatar") Renders: <input name="avatar" type="file" />
func Hidden ¶
Hidden Creates a hidden input field not visible to users. Example: input.Hidden("csrf_token", "abc123") Renders: <input name="csrf_token" value="abc123" type="hidden" />
func Image ¶
Image Creates an image submit button with graphical representation. Example: input.Image("submit", "/images/submit.png") Renders: <input name="submit" type="image" src="/images/submit.png" />
func Month ¶
func Month(name string) *element
Month Creates a month picker input field. Example: input.Month("expiry") Renders: <input name="expiry" type="month" />
func New ¶
func New() *element
New Creates a new input element without any initial attributes. Example: input.New().Type(inputtype.Text).Name("username") Renders: <input name="username" type="text" />
func Number ¶
func Number(name string) *element
Number Creates a numeric input field with spinner controls. Example: input.Number("quantity") Renders: <input name="quantity" type="number" />
func Password ¶
func Password(name string) *element
Password Creates a password input field that obscures entered characters. Example: input.Password("password") Renders: <input name="password" type="password" />
func Radio ¶
Radio Creates a radio button input for exclusive selection within a group. Example: input.Radio("gender", "male") Renders: <input name="gender" value="male" type="radio" />
func Range ¶
func Range(name string) *element
Range Creates a range slider input for selecting numeric values. Example: input.Range("volume") Renders: <input name="volume" type="range" />
func Reset ¶
func Reset(value string) *element
Reset Creates a reset button input that clears form values. Example: input.Reset("Clear Form") Renders: <input value="Clear Form" type="reset" />
func Search ¶
func Search(name string) *element
Search Creates a search input field optimised for search queries. Example: input.Search("query") Renders: <input name="query" type="search" />
func Submit ¶
func Submit(value string) *element
Submit Creates a submit button input for form submission. Example: input.Submit("Submit Form") Renders: <input value="Submit Form" type="submit" />
func Tel ¶
func Tel(name string) *element
Tel Creates a telephone number input field. Example: input.Tel("phone") Renders: <input name="phone" type="tel" />
func Text ¶
Text Creates a text input field for single-line text entry. Example: input.Text("title", "Mr") Renders: <input name="title" value="Mr" type="text" />
func Time ¶
func Time(name string) *element
Time Creates a time picker input field. Example: input.Time("appointment") Renders: <input name="appointment" type="time" />