Skip to content

SearchInput

pywry.toolbar.SearchInput

Bases: ToolbarItem

A search input field with magnifying glass icon and debounced events.

Includes a muted theme-aware search icon on the left. Browser behaviors (spellcheck, autocomplete, autocorrect, autocapitalize) are disabled by default for cleaner search/filter UX.

Emits {value: ..., componentId: ...} on search input change.

ATTRIBUTE DESCRIPTION
value

Current search text value (default: "").

TYPE: str

placeholder

Placeholder text (default: "Search...").

TYPE: str

debounce

Milliseconds to wait before emitting (default: 300).

TYPE: int

spellcheck

Enable browser spell checking (default: False).

TYPE: bool

autocomplete

Browser autocomplete behavior (default: "off").

TYPE: str

autocorrect

Enable browser auto-correction: "on" or "off" (default: "off").

TYPE: str

autocapitalize

Control mobile keyboard capitalization (default: "off").

TYPE: str

Examples:

>>> SearchInput(
...     label="Filter:",
...     event="filter:search",
...     placeholder="Type to filter...",
...     debounce=200,
... )

Functions

build_html

build_html() -> str

Build search input HTML with icon.

build_inline_html

build_inline_html() -> str

Build inline search input HTML for embedding in dropdowns.

Returns just the wrapper+icon+input without label, optimized for use inside Select/MultiSelect dropdown headers.

auto_generate_component_id

auto_generate_component_id() -> ToolbarItem

Auto-generate component_id based on type if not provided.

validate_event_name classmethod

validate_event_name(v: str) -> str

Validate event follows namespace:event-name pattern.