Documentation
¶
Index ¶
Constants ¶
const ( PartIcon = widget.Part("icon") // the square coloured cap holding the magnifier PartGlyph = widget.Part("glyph") // the magnifier <svg> itself PartInput = widget.Part("input") // the text field, the body of the bar )
const NameSearchBar = widget.Name("searchbar")
NameSearchBar is the widget identity; it produces the class prefix "searchbar" and the part classes "searchbar__icon", "searchbar__glyph", "searchbar__input".
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SearchBar ¶
type SearchBar struct {
Element // value embed — NEVER *dom.Element (TinyGo heap constraint)
// Placeholder is the field's placeholder text. Empty uses defaultPlaceholder.
Placeholder string
// contains filtered or unexported fields
}
SearchBar is a single-control filter bar: a magnifier cap followed by a text field. It holds no list and knows nothing about what it filters — it reports the term and the host decides what that means.
It satisfies widget.Filterable, which is the whole reason it is swappable: a host holds the seam, not this type, so a calendar or a select that also implements Filterable takes its place with no change to the host.
func (*SearchBar) IconSvg ¶
IconSvg registers the bar's magnifier. Method receiver (not a free function) so tinywasm/ssr detects a single receiver type for the package and emits RenderCSS + IconSvg together.
func (*SearchBar) OnFilterChange ¶
OnFilterChange implements widget.Filterable: it registers the sink for every keystroke. The host calls it once while wiring its filter slot; passing nil clears the sink.
The signature is fixed by widget.Filterable — do not add a parameter, do not return anything, do not add a companion getter.
func (*SearchBar) RenderCSS ¶
func (s *SearchBar) RenderCSS() *css.Stylesheet
RenderCSS defines the search bar's visual contract using the style DSL.
func (*SearchBar) WidgetKind ¶
Form, not Combobox: the bar has no popup and no options list. Combobox would license Open/Selected states this control can never be in.