Skip to main content

Module field

Module field 

Source
Expand description

Labelled form fields, inputs, input groups, choice cards, and the error summary, from field.css and form-variants.css.

Re-exports§

pub use Field_completions::Component::Field;
pub use Input_completions::Component::Input;
pub use Textarea_completions::Component::Textarea;
pub use NativeSelect_completions::Component::NativeSelect;
pub use InputGroup_completions::Component::InputGroup;
pub use InputAddon_completions::Component::InputAddon;
pub use ErrorSummary_completions::Component::ErrorSummary;
pub use Choice_completions::Component::Choice;

Structs§

ChoiceProps
Properties for the Choice component.
ErrorSummaryProps
Properties for the ErrorSummary component.
FieldError
One problem listed in an ErrorSummary.
FieldProps
Properties for the Field component.
InputAddonProps
Properties for the InputAddon component.
InputGroupProps
Properties for the InputGroup component.
InputProps
Properties for the Input component.
NativeSelectProps
Properties for the NativeSelect component.
TextareaProps
Properties for the Textarea component.

Enums§

InputSize
Input sizes.
InputType
The HTML input types this library styles. Text is the default and is not written, as in upstream’s markup.
InputVariant
Input surface treatments.
Necessity
Whether a field is marked as required or optional.

Functions§

Choice
A radio drawn as a card with a title and description, inside a CheckGroup given radios.
ErrorSummary
The list of problems after a submit, linking to each field. It takes focus whenever it appears with errors, so keyboard and screen reader users land on it.
Field
A visible label, an optional hint and error, and one control, wired together.
Input
A single-line text input. Inside a Field it is labelled automatically; anywhere else, give it an aria_label.
InputAddon
Fixed text beside an input, such as a unit or a URL scheme.
InputGroup
One box holding an Input with InputAddons before or after it.
NativeSelect
A native <select> styled as an input, for short fixed lists. Children are options.
Textarea
A multi-line text input; autosize grows it with its content where supported.