Skip to content

Search Field

A specialized search input component that provides consistent styling and behavior for search functionality across the application.

The SearchField component is built on top of InputField and offers additional features specific to search interactions, such as optional back navigation, leading/trailing icons, and container styling variants.


Basic search field with a container background and microphone icon.


Search field without a container background, with search and microphone icons.


Search field with a back button and clear icon for navigation.


PropertyTypeDescription
typeSearchFieldTypeVisual style of the search field (withContainer or noContainer).
hintTextString?Placeholder text displayed when the search field is empty.
fillColorColor?Background color of the search field.
borderRadiusBorderRadiusGeometry?Corner radius for the search field borders.
prefixIconWidget?Widget displayed at the start of the search field.
suffixIconWidget?Widget displayed at the end of the search field.
onChangedFunction(String)?Callback function when the search text changes.
controllerTextEditingController?Controller for the search field input.
autofocusboolWhen true, the search field will be focused when first created.
heightdoubleHeight of the search field container.
textInputActionTextInputAction?Determines the action button on the keyboard.
contentPaddingEdgeInsetsGeometry?Custom padding for the content inside the search field.
borderBoxBorder?Custom border for the search field.
leadingWidget?Custom leading widget (typically used for back button).
autoImautomaticallyImplyLeadingboolWhen true, shows a default back button if no leading widget provided.
onTapBackFunction()?Callback function when the back button is tapped.