Skip to content

SearchBar

import { SearchBar } from "material.slint";
export component Example inherits Window {
width: 300px;
height: 100px;
background: transparent;
SearchBar {
placeholder: "Search...";
width: 280px;
height: 56px;
}
}
slint

A SearchBar is a text input field designed for search functionality, with optional leading/trailing icons and avatar.

image default: the empty image

An optional avatar image displayed in the search bar.

color default: #00000000

The background color for the avatar.

int (in-out) default: 0

The index of the currently selected search result item.

string default: ""

Text displayed when there are no search results.

[struct ListItem] default: a struct with all default values

ListItem

This structure represents a ListItem with a text, supporting text, avatar icon, avatar text, avatar background, avatar foreground, and action icon.

  • text (string): The text to display in the item.
  • supporting_text (string): The supporting text to display in the item.
  • avatar-icon (image): The avatar icon to display in the item.
  • avatar-text (string): The avatar text to display in the item.
  • avatar-background (color): The avatar background color to display in the item.
  • avatar-foreground (color): The avatar foreground color to display in the item.
  • action-icon (image): The action icon to display in the item.

An array of search result items to display.

image default: the empty image

The icon displayed at the start of the search bar.

string default: ""

The placeholder text displayed when the search bar is empty.

string (in-out) default: ""

The current text in the search bar.

image default: the empty image

The icon displayed at the end of the search bar.

Invoked when a search result item action is triggered.

Invoked when the user presses Enter in the search bar.

Invoked when the text in the search bar changes.

key-pressed(event: KeyEvent) -> EventResult

Section titled “key-pressed(event: KeyEvent) -> EventResult”

Invoked when a key is pressed in the search bar.

key-released(event: KeyEvent) -> EventResult

Section titled “key-released(event: KeyEvent) -> EventResult”

Invoked when a key is released in the search bar.


© 2025 SixtyFPS GmbH