Search Bar
- Web Components
- Flutter
Demo
zeta-web v0.6.6
Web Components
Supports speech recognition search on Chrome.
Storybook
https://design.zebra.com/web/storybook/?path=/docs/components-search--docs
Slots
Name | Description | Type |
---|---|---|
leading | Leading icon | text |
Attributes
Name | Description | Type | Default |
---|---|---|---|
round | boolean | string | undefined | |
hasIcon | Show microphone icon. | boolean | false |
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 | "small" | "medium" | "large" | "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
ZetaSearchBar provides input field for searching.
Widgetbook
Inheritance
Object
> DiagnosticableTree
> Widget
> StatefulWidget
> FormField<String>
> ZetaFormField<String>
> ZetaTextFormField
Constructors
Constructor for ZetaSearchBar.
ZetaSearchBar.new({AutovalidateMode? autovalidateMode, FormFieldValidator<String>? validator, FormFieldSetter<String>? onSaved, ValueChanged<String?>? onChange, ValueChanged<String?>? onFieldSubmitted, ZetaFormFieldRequirement? requirementLevel, TextEditingController? controller, bool disabled = false, String? initialValue, ZetaWidgetSize size = ZetaWidgetSize.medium, ZetaWidgetBorder shape = ZetaWidgetBorder.rounded, String? placeholder, Future<String?> onSpeechToText()?, bool showSpeechToText = true, FocusNode? focusNode, TextInputAction? textInputAction, String? microphoneSemanticLabel, String? clearSemanticLabel, Key? key})
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<String> | final inherited |
clearSemanticLabel | Label passed to the clear button for semantic purposes. | String? | final |
controller | The controller for the text form field. | TextEditingController? | final inherited |
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 |
focusNode | A FocusNode for the underlying TextFormField | FocusNode? | 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 |
initialValue | An optional value to initialize the form field to, or null otherwise. | String? | final inherited |
key | Controls how one widget replaces another widget in the tree. | Key? | final inherited |
microphoneSemanticLabel | Label passed to the microphone button for semantic purposes. | String? | final |
onChange | Called whenever the form field changes. | ValueChanged<String?>? | final inherited |
onFieldSubmitted | Called whenever the form field is submitted. | ValueChanged<String?>? | final inherited |
onSaved | An optional method to call with the final value when the form is saved via | FormFieldSetter<String>? | final inherited |
onSpeechToText | A callback, which is invoked when the microphone button is pressed. | Future<String?> Function()? | final |
placeholder | Placeholder text for the search field. | String? | 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 |
shape | Determines the shape of the input field. | ZetaWidgetBorder | final |
showSpeechToText | Determines if there should be a Speech-To-Text button. | bool | final |
size | Determines the size of the input field. | ZetaWidgetSize | final |
textInputAction | The type of action button to use for the keyboard. | TextInputAction? | final |
validator | An optional method that validates an input. Returns an error string to | FormFieldValidator<String>? | final inherited |
Methods
Name | Description | Type | Features |
---|---|---|---|
createElement() | Creates a StatefulElement to manage this widget's location in the tree. | StatefulElement | inherited |
createState() | Creates the mutable state for this widget at a given location in the tree. | FormFieldState<String> | override |
debugDescribeChildren() | Returns a list of DiagnosticsNode objects describing this node's children. | List<DiagnosticsNode> | inherited |
debugFillProperties(DiagnosticPropertiesBuilder properties) | Add additional properties associated with the node. | void | override |
noSuchMethod(Invocation invocation) | Invoked when a nonexistent method or property is accessed. | dynamic | inherited |
paddingAll(double space) | Available on Widget, provided by the SpacingWidget extension | Widget | undefined |
paddingBottom(double space) | Available on Widget, provided by the SpacingWidget extension | Widget | undefined |
paddingEnd(double space) | Available on Widget, provided by the SpacingWidget extension | Widget | undefined |
paddingHorizontal(double space) | Available on Widget, provided by the SpacingWidget extension | Widget | undefined |
paddingStart(double space) | Available on Widget, provided by the SpacingWidget extension | Widget | undefined |
paddingTop(double space) | Available on Widget, provided by the SpacingWidget extension | Widget | undefined |
paddingVertical(double space) | Available on Widget, provided by the SpacingWidget extension | Widget | undefined |
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) | Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep. | DiagnosticsNode | inherited |
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) | A string representation of this object. | String | inherited |
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) | Returns a string representation of this node and its descendants. | String | inherited |
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) | Returns a one-line detailed description of the object. | String | inherited |
toStringShort() | A short, textual description of this widget. | String | inherited |
Figma