Select Input
A text input field for selecting from a list of options.
Figma Link
- Web Components
- Flutter
Demo
zeta-web v0.12.9
Web Components
Currently no typing or multi-select support.
Storybook
https://design.zebra.com/web/storybook/index.html?path=/docs/components-select-input--docs
Attributes
| Name | Description | Type | Default |
|---|---|---|---|
| error | Whether field is in error state. | boolean | false |
| isSelected | Whether an option is selected. | boolean | false |
| open | Whether the dialog is open. | boolean | false |
| icon | Leading icon name. | ZetaIconName | undefined | undefined |
| label | Label shown above the field. | string | "" |
| hintText | Hint text shown below text field.if error, then errorText is shown instead. | string | "" |
| errorText | Error hint textShown if error, replaces hintText. | string | "" |
| optionsDialogHeight | Height of options dropdownDefault is 200px | number | 200 |
Inherited Attributes
| Name | Description | Type | Default | Inherited From |
|---|---|---|---|---|
| autoCapitalize | Whether inputted text is automatically capitalized and how. Only takes effect on non-keyboard entry | "none" | "off" | "sentences" | "on" | "words" | "characters" | undefined | undefined | FormField |
| autoComplete | AutoFill | undefined | undefined | FormField | |
| name | The name of the form control. | string | "" | FormField |
| id | The id of the form control. | string | "" | FormField |
| required | Indicates whether the form control is required to be filled out before submitting the form. | boolean | false | FormField |
| value | The value of the Form Control that is submitted when part of a form. | string | null | null | FormField |
| checked | The state of the Switch or Checkbox that is submitted when part of a form. | boolean | undefined | FormField |
| indeterminate | The state of the Switch or Checkbox defined by a mixed or unknown state. | boolean | false | FormField |
| placeholder | Placeholder text shown when value is empty. | string | undefined | undefined | FormField |
| min | The minimum value for number inputs | number | undefined | undefined | FormField |
| max | The maximum value for number inputs | number | undefined | undefined | FormField |
| readOnly | Placeholder text shown when value is empty. | boolean | undefined | undefined | FormField |
| spellCheck | Whether to spellcheck the input | boolean | "default" | undefined | undefined | FormField |
| disabled | Boolean for if component is disabled.This will apply disabled styles. | boolean | false | Interactive |
| size | Size of component | SizeType | "medium" | Size |
| rounded | Whether the component is rounded or sharp.When true, rounded will set the border radius of the first child, and any children with class 'contourable-target' to --radius-minimal.Otherwise, this value will be --radius-none. | boolean | undefined | true | Contourable |
| tabIndex | The tab index of the component, used to determine the order in which elements receive focus when the user navigates through the document by pressing the Tab key. | number | 0 | Interactive |
Demo
Widgetbook
Inheritance
Object > DiagnosticableTree > Widget > StatefulWidget > FormField<T> > ZetaFormField<T>
Constructors
Constructor of ZetaSelectInput
ZetaSelectInput.new({Key? key, bool? rounded, FormFieldValidator<T>? validator, ValueChanged<T?>? onFieldSubmitted, AutovalidateMode? autovalidateMode, FormFieldSetter<T>? onSaved, bool disabled = false, T? initialValue, ValueChanged<T?>? onChange, ZetaFormFieldRequirement? requirementLevel, required List<ZetaDropdownItem<T>> items, ValueSetter<String>? onTextChanged, ZetaWidgetSize size = ZetaWidgetSize.medium, String? label, String? hintText, Widget? prefix, String? placeholder, String? errorText, String? dropdownSemantics})
Properties
| Name | Description | Type | Features |
|---|---|---|---|
| autovalidateMode | Used to enable/disable this form field auto validation and update its | AutovalidateMode | final inherited |
| builder | Function that returns the widget representing this form field. | FormFieldBuilder<T> | final inherited |
| dropdownSemantics | The semantics label for the dropdown button. | String? | final |
| enabled | Whether the form is able to receive user input. | bool | final inherited |
| errorBuilder | Function that returns the widget representing the error to display. | FormFieldErrorBuilder? | final inherited |
| errorText | The error text shown beneath the input when the validator fails. | String? | final |
| forceErrorText | An optional property that forces the FormFieldState into an error state | String? | final inherited |
| hashCode | The hash code for this object. | int | no setter inherited |
| hintText | If provided, displays a hint below the input field. | String? | final |
| initialValue | An optional value to initialize the form field to, or null otherwise. | T? | final inherited |
| items | Input items as list of ZetaDropdownItem | List<ZetaDropdownItem<T>> | final |
| key | Controls how one widget replaces another widget in the tree. | Key? | final inherited |
| label | If provided, displays a label above the input field. | String? | final |
| onChange | Called whenever the form field changes. | ValueChanged<T?>? | final inherited |
| onFieldSubmitted | Called whenever the form field is submitted. | ValueChanged<T?>? | final inherited |
| onReset | An optional method to call when the form field is reset via | VoidCallback? | final inherited |
| onSaved | An optional method to call with the final value when the form is saved via | FormFieldSetter<T>? | final inherited |
| onTextChanged | Handles changes of input text | ValueSetter<String>? | final |
| placeholder | The placeholder for the input. | String? | final |
| prefix | The prefix widget for the input. | Widget? | final |
| requirementLevel | The requirement level of the form field. | ZetaFormFieldRequirement? | final inherited |
| restorationId | Restoration ID to save and restore the state of the form field. | String? | final inherited |
| runtimeType | A representation of the runtime type of the object. | Type | no setter inherited |
| size | Determines the size of the input field. | ZetaWidgetSize | final |
| validator | An optional method that validates an input. Returns an error string to | FormFieldValidator<T>? | final inherited |