Next: (hygguile components layout), Previous: (hygguile components icon), Up: API
Create a labelled HTML checkbox input.
Native checkboxes work without JavaScript and are keyboard accessible.
The descriptive text shown next to the checkbox.
The form field name.
An optional explicit HTML identifier; defaults to name.
The value submitted when the box is checked.
A boolean rendering the pre-checked state.
A boolean making the checkbox mandatory.
A boolean disabling the control.
Optional helper copy linked through aria-describedby.
Optional validation message rendered with role="alert".
List of symbols styling the checkbox control.
List of symbols styling the label text.
List of symbols styling the wrapping row.
(checkbox #:label "I accept the terms" #:name "terms" #:required #t)
Create an HTML <fieldset> grouping related form controls.
The list of form controls or fragments contained by the group.
An optional caption rendered as the fieldset legend.
List of symbols representing container CSS classes.
(fieldset (list (input #:label "City" #:name "city")) #:legend "Address")
Create a working HTML <form> around a group of controls.
This is the wrapper for the common case: a form that posts its fields to
a server-rendered page. It works with JavaScript disabled, because the
browser itself serialises the controls and navigates to action,
and it opts into the browser’s native validation unless you pass
#:novalidate #t and handle the messages yourself.
Pass #:submit to append a ready-made submit button, or place your
own buttons in content when a form needs several actions.
The controls and fieldsets that make up the form.
The URL the browser navigates to on submission.
A symbol or string, 'post by default; use 'get for
searches.
An optional encoding symbol such as 'multipart/form-data,
required for file uploads.
An optional browsing context string, e.g. "_blank".
An optional HTML identifier.
An optional form name string.
An optional string ("on" or "off") for the whole form.
A boolean switching off native validation, for forms validated by hand.
An optional accessible name when no visible heading describes the form.
An optional label for a submit button appended after the fields.
List of symbols representing the form layout CSS classes.
(form (list (fieldset (list (input #:label "Email" #:name "email"
#:type 'email #:required #t
#:autocomplete "email"))
#:legend "Newsletter"))
#:action "/subscribe"
#:submit "Subscribe")
Create an accessible inline form validation message.
The message is announced by assistive technology through
role="alert".
The error message string or inline nodes.
List of symbols representing typography CSS classes.
(form-error "Please provide a valid email address.")
Create a small helper paragraph providing extra field guidance.
The helper copy string or inline nodes.
List of symbols representing typography CSS classes.
(help-text "We will never share your email.")
Construct an HTML <input> component with a matching label.
The generated field always carries an id, and the label is bound
to it through the for attribute, so clicking the label focuses
the input. Pass #:autocomplete to help browsers and password
managers fill the field with the right data (e.g. "name",
"email", "street-address", "current-password",
"one-time-code").
The descriptive text string displaying the identity of the field.
The name mapping configuration string bound onto form serialization attributes.
An optional explicit HTML identifier; defaults to name.
The standard default textual configuration payload string.
The ambient string text descriptive hint applied when the field boundary is unpopulated.
A configuration symbol managing browser input rendering choices (e.g.,
'text, 'password).
A boolean property indicating if form verification forces evaluation validation.
An optional string forwarding the HTML autocomplete hint to the
browser.
An optional string forwarding the HTML autocapitalize behaviour
(e.g. "none", "words").
An optional string ("true" or "false") controlling native
spell checking.
An optional string suggesting a virtual keyboard layout (e.g.
"email", "numeric").
A boolean that disables the control.
A boolean that makes the control read-only.
A boolean that focuses the control on page load.
An optional regular expression string enforcing the value format.
An optional lower bound for numeric or date inputs.
An optional upper bound for numeric or date inputs.
An optional numeric increment for numeric inputs.
An optional datalist identifier offering autocomplete suggestions.
Optional helper copy rendered below the field and linked with
aria-describedby.
Optional validation message rendered below the field with
role="alert".
List of symbols representing layout utility CSS classes for the input field.
List of symbols representing presentation utility CSS classes for the label field.
List of symbols regulating structure container box margins and gaps.
(input #:label "Email Address" #:name "email" #:type 'email #:autocomplete "email" #:required #t)
Create an HTML <legend> caption for a fieldset.
The legend caption string or inline nodes.
List of symbols representing typography CSS classes.
(legend "Shipping address")
Create a labelled HTML radio button.
Give several radios the same name to form a mutually exclusive group. Radios are native controls, so they keep working with JavaScript disabled.
The descriptive text shown next to the radio.
The shared form field name identifying the group.
An optional explicit HTML identifier; defaults to a value derived from value.
The value submitted when this radio is selected.
A boolean rendering the pre-selected state.
A boolean making the group mandatory.
A boolean disabling the control.
List of symbols styling the radio control.
List of symbols styling the label text.
List of symbols styling the wrapping row.
(radio #:label "Small" #:name "size" #:value "s" #:checked #t)
Create a labelled HTML range slider.
The descriptive text shown above the slider.
The form field name.
An optional explicit HTML identifier; defaults to name.
The optional initial slider position.
The lowest accepted value. Defaults to 0.
The highest accepted value. Defaults to 100.
The increment between accepted values. Defaults to 1.
A boolean disabling the control.
List of symbols styling the range control.
(range #:label "Volume" #:name "volume" #:min 0 #:max 11 #:value 7)
Create a styled on/off switch backed by a native checkbox.
The switch is pure CSS and a real checkbox underneath, so it works
without JavaScript. The visual track is styled by .hg-switch.
The descriptive text shown next to the switch.
The form field name.
An optional explicit HTML identifier; defaults to name.
The value submitted when the switch is on.
A boolean rendering the switch in the on position.
A boolean disabling the control.
(switch #:label "Enable notifications" #:name "notifications" #:checked #t)
Construct an HTML <textarea> multiline field block.
The explicit header string informing users of required field contexts.
The unique string structural identifier mapping the entity across standard DOM tables.
An optional explicit HTML identifier; defaults to name.
The initial text block paragraph payload string nested inside the block.
An optional hint string shown while the field is empty.
An optional suggested visible number of text rows.
An optional suggested visible width in average character widths.
A field completion mandatory requirement boolean validation gate switch.
An optional string forwarding the HTML autocomplete hint to the
browser.
An optional maximum accepted character count.
An optional string ("true" or "false") controlling native
spell checking.
A boolean that disables the control.
A boolean that makes the control read-only.
A boolean that focuses the control on page load.
Optional helper copy rendered below the field and linked with
aria-describedby.
Optional validation message rendered below the field with
role="alert".
List of symbols targeting specific dimensions and borders configuration styles.
List of symbols handling sizing constraints applied onto the matching label tags.
List of symbols managing outer wrapper responsive card flex constraints.
(textarea #:label "User Bio" #:name "biography" #:value "Born in Scheme...")
Next: (hygguile components layout), Previous: (hygguile components icon), Up: API