OmniBox
Description
An omnibox search component
Omnibox provides a powerful input field for switching between a chat and a search interaction. For search, it also provides support for parsing and visual rendering of logical operators like AND, OR, NOT, parenthesis, and quotes.
API reference
public class OmniBox : IComponent, IHasBackgroundColor, ITabIndexA heavyweight omni-search / autocomplete component with inline filter chips, multiple search modes (search/chat) and async value providers.
Constructors
Properties
public ObservableList<InlineFilterChip> InlineFilterChips { get; }Gets or sets the inline filter chips.
public ThinkingEffort SelectedThinkingEffortGets or sets the selected thinking effort.
public bool IsModelLockedReturns a value indicating whether the component is model locked.
public bool IsGenerating { get ; set ; }Returns a value indicating whether the component is generating.
public bool IsEnabled { get ; set ; }Gets or sets a value indicating whether the component is interactive (enabled).
public string SearchPlaceholder { get ; set ; }Gets or sets the search placeholder.
public string ChatPlaceholder { get ; set ; }Gets or sets the chat placeholder.
Methods
public static SearchQuery ParseQuery(string input, bool tokenIgnoreCase = false)Parses the query.
public OmniBox RegisterSnap(SnapHandler snap)Registers a snap-handler that can convert recognized input into an inline filter chip.
public OmniBox RegisterSnaps(params SnapHandler[] snaps)Registers multiple snap-handlers in one call.
public OmniBox RegisterFilterSnap(FilterSnapHandler filter)Registers a filter snap handler that creates an inline filter chip.
public OmniBox RegisterFilterSnaps(params FilterSnapHandler[] filters)Registers multiple filter snap handlers in one call.
public OmniBox OnSearch(SearchEventHandler onSearch)Registers a callback invoked when the search event fires.
public OmniBox OnChat(ChatEventHandler onChat)Registers a callback invoked when the chat event fires.
public OmniBox OnStop(StopEventHandler onStop)Registers a callback invoked when the stop event fires.
public OmniBox OnModelChanged(ModelChangedEventHandler onModelChanged)Registers a callback invoked when the model changed event fires.
public OmniBox SetModels(params ModelOption[] models)Sets the models of the component.
public OmniBox SetModels(IEnumerable<ModelOption> models)Sets the models of the component.
public OmniBox LockModel(ModelOption model)Locks the OmniBox to the given model option so users cannot pick another.
public OmniBox SetThinkingEffort(ThinkingEffort effort)Sets the thinking effort of the component.
public OmniBox OnInput(ComponentEventHandler<OmniBox, Event> onInput)Registers a callback invoked when the input event fires.
public OmniBox OnKeyDown(ComponentEventHandler<OmniBox, KeyboardEvent> onKeyDown)Registers a callback invoked when the key down event fires.
public OmniBox OnKeyUp(ComponentEventHandler<OmniBox, KeyboardEvent> onKeyUp)Registers a callback invoked when the key up event fires.
public OmniBox OnKeyPress(ComponentEventHandler<OmniBox, KeyboardEvent> onKeyPress)Registers a callback invoked when the key press event fires.
public OmniBox OnFocus(ComponentEventHandler<OmniBox, Event> onFocus)Registers a callback invoked when the focus event fires.
public OmniBox OnBlur(ComponentEventHandler<OmniBox, Event> onBlur)Registers a callback invoked when the blur event fires.
public OmniBox WithHistory(Func<Task<SearchQuery[]>> historyFetcher)Returns the component configured with the given history.
public OmniBox SetKeyboardShortcut(params string[] keys)Registers a global keyboard shortcut that focuses the OmniBox search input when pressed, and renders a visual chip showing the shortcut on the right side of the search box. In SearchAndChat mode, pressing the shortcut also switches the active mode to Search. Modifier names are case-insensitive ("Ctrl", "Cmd", "Meta", "Alt", "Shift"). Example: .
public OmniBox SetSearchRightText(string text)Sets the search right text of the component.
public OmniBox SetSearchText(string text)Sets the search text of the component.
public OmniBox SetSearchPlaceholder(string text)Sets the search placeholder of the component.
public OmniBox SetChatText(string text)Sets the chat text of the component.
public OmniBox SetChatPlaceholder(string text)Sets the chat placeholder of the component.
public OmniBox Height(UnitSize unitSize)Gets or sets the CSS height of the component.
Events
public event ComponentEventHandler<OmniBox, KeyboardEvent> KeyDownRaised when key down occurs.
public event ComponentEventHandler<OmniBox, KeyboardEvent> KeyUpRaised when key up occurs.
public event ComponentEventHandler<OmniBox, KeyboardEvent> KeyPressRaised when key press occurs.
public event ComponentEventHandler<OmniBox, Event> ReceivedFocusRaised when received focus occurs.