Skip to content

Extras

CommandPalette

Bit.BlazorUI.ExtrasCommandMenuCmdkSpotlight

BitCommandPalette is an accessible, keyboard-first command palette: the Ctrl+K (Cmd+K on a Mac) box that fuzzy-searches every page, action and setting of an app and runs the one picked, with nested pages, prompts, multi-select, async sources, recents and global shortcuts. Matching, ranking and every decision run in C#; the browser only shows the native dialog and listens for keys.

CSS variables

The public custom properties this component reads off its root, for what no parameter covers.

Every variable is read with a fallback and never declared by the component, so it inherits like any other custom property: set one on :root (or in a [bit-theme] block) to restyle every instance, on any ancestor to restyle the ones inside it, or on the Style of one instance to restyle it - and any instance nested inside it, which inherits the value too; a parameter changes one alone, as does the real CSS property on the instance's Style / Styles when that property does not inherit (opacity: 1 keeps one disabled instance undimmed without undimming a disabled one inside it), while an inherited one such as color or font-family also reaches the nested instances that do not set it themselves. Leave a variable unset and the component falls back to the theme token beside it.

BitCommandPalette CSS variables

Name Default value Description
--bit-CommandPalette-width 640px Width of the dialog (920px with a detail pane).
--bit-CommandPalette-max-height min(70vh, 560px) Tallest the list grows, with its header and footer.
--bit-CommandPalette-top 12vh Distance of the dialog from the top of the viewport.
--bit-CommandPalette-radius var(--bit-shp-radius-dialog) Corner radius of the dialog.
--bit-CommandPalette-background var(--bit-clr-bg-pri) Fill of the dialog and of an inline palette.
--bit-CommandPalette-color var(--bit-clr-fg-pri) Text of the palette.
--bit-CommandPalette-border-color var(--bit-clr-brd-sec) Lines between the header, the list and the footer, and the edge of an inline palette.
--bit-CommandPalette-shadow var(--bit-shd-dialog) Elevation of the dialog.
--bit-CommandPalette-backdrop var(--bit-clr-bg-overlay) Fill of the page behind the dialog.
--bit-CommandPalette-row-height var(--bit-siz-item-lg) Least height of a row. Virtualize pins the rows to BitCommandPaletteOptions.RowHeight instead.
--bit-CommandPalette-item-radius var(--bit-shp-radius-md) Corner radius of a row.
--bit-CommandPalette-active-background var(--bit-clr-bg-pri-hover) Fill of the active row.
--bit-CommandPalette-accent var(--bit-clr-pri) The mode chip, badges, checked rows, switches that are on and the busy spinner.
--bit-CommandPalette-mark-background var(--bit-clr-pri-tint) Fill of the matched characters.
--bit-CommandPalette-detail-width 40% Width of the detail pane.
--bit-CommandPalette-focus-color the global focus ring Focus ring of the palette's buttons.
--bit-CommandPaletteTrigger-height var(--bit-siz-ctrl-md) Height of a BitCommandPaletteTrigger.
--bit-CommandPaletteTrigger-background var(--bit-clr-bg-sec) Fill of a BitCommandPaletteTrigger.
--bit-CommandPaletteTrigger-color var(--bit-clr-fg-sec) Text and icon of a BitCommandPaletteTrigger.
--bit-CommandPaletteTrigger-border-color var(--bit-clr-brd-pri) Edge of a BitCommandPaletteTrigger.
--bit-CommandPaletteTrigger-radius var(--bit-shp-radius-control) Corner radius of a BitCommandPaletteTrigger.
--bit-CommandPaletteTrigger-focus-color the global focus ring Focus ring of a BitCommandPaletteTrigger.

API

Every parameter, public member, sub-class and enum this component exposes.

BitCommandPalette parameters

Name Type Default value Description
ChildContent RenderFragment? null The declarative BitCommandPaletteGroup and BitCommandPaletteOption children of the palette.
Classes BitCommandPaletteClassStyles? null Custom CSS classes for the different parts of the command palette.
Commands IEnumerable<BitCommandPaletteCommand>? null Commands supplied directly to this palette, in addition to the ones registered through IBitCommandPaletteService and declared in its markup.
DetailTemplate RenderFragment<BitCommandPaletteCommand>? null Renders a detail pane beside the list for the active command, Raycast style.
DisablePointerSelection bool false Ignores the pointer hovering a row for choosing the active one: only the keys and a click move it.
EmptyTemplate RenderFragment? null What a page with no commands on it at all shows, in place of EmptyText.
EmptyText string? null The text a page with no commands on it at all shows. Default: the Empty of the palette's strings, which falls back to BitStrings.NoItemsFound.
EnableHistory bool? null Overrides BitCommandPaletteOptions.EnableHistory: recents, pins and frecency.
FooterTemplate RenderFragment<BitCommandPaletteStateContext>? null Replaces the footer with its keyboard hints and toasts, with a snapshot of the palette's state.
GroupHeaderTemplate RenderFragment<string>? null Replaces the content of a group heading; receives the heading text.
GroupWhenSearching bool? null Overrides BitCommandPaletteOptions.GroupWhenSearching: keeps the group headings while a query is typed.
HeaderTemplate RenderFragment<BitCommandPaletteStateContext>? null Content rendered above the search box, with a snapshot of the palette's state.
HighlightMatches bool? null Overrides BitCommandPaletteOptions.HighlightMatches: marks the matched characters.
IconTemplate RenderFragment<BitCommandPaletteCommand>? null Renders the icon of every row; receives the command. Render nothing for no icon.
IncludeRegisteredCommands bool true Whether the commands, sources and modes registered through IBitCommandPaletteService are part of this palette. Set it to false for a palette that lists only its own, such as an inline search of one page's settings.
Inline bool false Renders the palette in the page instead of in a modal dialog. It is always open, Escape goes back a page or clears the query, and it leaves the toggle shortcut, the global shortcuts and the service's Open/Close/Execute to the modal palette. Set before the first render.
ItemTemplate RenderFragment<BitCommandPaletteItemContext>? null Replaces the content of every row. The row element itself - its role, ARIA state and click handling - stays the palette's.
LoadingTemplate RenderFragment? null Replaces the loading state shown while a lazily loaded page or an async source has nothing to show yet.
Loop bool? null Overrides BitCommandPaletteOptions.Loop: the arrow keys wrap around the list.
NoResultsTemplate RenderFragment<string>? null What a search that matched nothing shows, in place of NoResultsText; receives the query.
NoResultsText string? null The text a search that matched nothing shows. Default: the NoResults of the palette's strings, which falls back to BitStrings.NoResultsFound.
OnClosed EventCallback Raised after the palette closed.
OnCommandExecuted EventCallback<BitCommandPaletteCommandExecutedEventArgs> Raised after a command of this palette ran, with its result and how long the handler took.
OnOpened EventCallback Raised after the palette opened.
OnQueryChanged EventCallback<string> Raised after every change of the query, with the raw text (a mode prefix included).
Open bool false Whether the modal palette is open. Two-way bindable.
Placeholder string? null The placeholder of the search box on the root page.
SearchNestedCommands bool? null Overrides BitCommandPaletteOptions.SearchNestedCommands: finds nested commands from the root page.
ShowFooter bool? null Overrides BitCommandPaletteOptions.ShowFooter.
ShowShortcuts bool? null Overrides BitCommandPaletteOptions.ShowShortcuts: shows each command's shortcut on its row.
Strings BitCommandPaletteStrings? null The words of the palette, the ones only screen readers hear included. Default: BitCommandPaletteOptions.Strings.
Styles BitCommandPaletteClassStyles? null Custom CSS styles for the different parts of the command palette.
ToggleShortcut string? null Overrides BitCommandPaletteOptions.ToggleShortcut (Mod+K), e.g. Ctrl+Shift+P.
TypoTolerance bool? null Overrides BitCommandPaletteOptions.TypoTolerance: retries a query that found nothing allowing a typo per term.
VimBindings bool? null Overrides BitCommandPaletteOptions.VimBindings: Ctrl+J / Ctrl+K move the selection.
Virtualize bool? null Overrides BitCommandPaletteOptions.Virtualize: renders the list through Virtualize.

BitCommandPalette public members

Name Type Default value Description
IsOpen bool Whether the dialog is open.
Query string The current raw query, a mode prefix included.
ActiveCommand BitCommandPaletteCommand? The command of the active row, if any.
OpenAsync (string? query, string? pageCommandId) => Task Opens the palette, optionally with a query (a mode prefix is honoured) or directly on a command's page.
CloseAsync () => Task Closes the palette.
ToggleAsync () => Task Opens the palette when it is closed and closes it when it is open.
SetQueryAsync (string query) => Task Sets the query as if typed, and renders the results.

BitComponentBase parameters

Name Type Default value Description
AriaLabel string? null Gets or sets the accessible label for the component, used by assistive technologies.
Class string? null Gets or sets the CSS class name(s) to apply to the rendered element.
Dir BitDir? null Gets or sets the text directionality for the component's content.
Disabled bool false Gets or sets a value indicating whether the component is disabled and cannot respond to user interaction.
ForceAnimation bool false Gets or sets a value indicating whether the component's animations play at their full duration even when reduced motion is requested.
HtmlAttributes Dictionary<string, object> new Dictionary<string, object>() Captures additional HTML attributes to be applied to the rendered element, in addition to the component's parameters. An attribute written on the component wins over an entry of the same name.
Id string? null Gets or sets the unique identifier for the component's root element.
Style string? null Gets or sets the CSS style string to apply to the rendered element.
TabIndex string? null Gets or sets the tab order index for the component when navigating with the keyboard.
Visibility BitVisibility BitVisibility.Visible Gets or sets the visibility state (visible, hidden, or collapsed) of the component.

BitComponentBase public members

Name Type Default value Description
UniqueId Guid Guid.NewGuid() Gets the readonly unique identifier for the component's root element, assigned when the component instance is constructed.
RootElement ElementReference Gets the reference to the root HTML element associated with this component.

BitCommandPaletteClassStyles properties

Name Type Default value Description
Root string? null Custom CSS classes/styles for the root element of the BitCommandPalette: the modal dialog, or the section of an inline palette.
Header string? null Custom CSS classes/styles for the header of the BitCommandPalette, which holds the breadcrumbs and the search box.
Input string? null Custom CSS classes/styles for the search box of the BitCommandPalette.
List string? null Custom CSS classes/styles for the list of the BitCommandPalette.
GroupHeading string? null Custom CSS classes/styles for each group heading of the BitCommandPalette.
Item string? null Custom CSS classes/styles for each row of the BitCommandPalette.
ActiveItem string? null Custom CSS classes/styles for the active row of the BitCommandPalette.
Empty string? null Custom CSS classes/styles for what a page of the BitCommandPalette with no commands at all shows.
NoResults string? null Custom CSS classes/styles for what a search of the BitCommandPalette that matched nothing shows.
Footer string? null Custom CSS classes/styles for the footer of the BitCommandPalette, with its keyboard hints and toasts.
Detail string? null Custom CSS classes/styles for the detail pane of the BitCommandPalette.

BitCommandPaletteStrings properties

Every word the palette says, the ones only screen readers hear included. Set its properties, or subclass it and override them (to read them from an IStringLocalizer), to localize. The templates are composite format strings: {0} is replaced.

Name Type Default value Description
Placeholder string "Type a command or search…" The search box placeholder on the root page.
PromptPlaceholder string "Type a value and press Enter…" The search box placeholder of a prompt that set none of its own.
NoResults string BitStrings.Current.NoResultsFound The state of a query that found nothing; {0} is the query. Default: NoResultsFound of Current, read when it is shown, so a BitStrings set later still reaches it.
NoResultsHint string "Try a different search, or check for typos." The hint under NoResults.
Empty string BitStrings.Current.NoItemsFound The state of a page with nothing on it. Default: NoItemsFound of Current, read when it is shown, so a BitStrings set later still reaches it.
Loading string "Searching…" The loading state, shown and announced while a lazily loaded page or an async source has not answered.
Recent string "Recent" The heading of the recently used commands.
Pinned string "Pinned" The heading of the pinned commands, and what a pinned row says to screen readers.
Suggestions string "Suggestions" The heading of the ungrouped commands when pinned or recent ones are listed above them.
Modes string "Modes" The heading of the mode hints on the empty query.
Actions string "Actions" The search box placeholder of the action panel.
Results string "Results" The accessible name of the result list on the root page.
Other string "Other" Not used by the palette itself; kept for templates.
Navigate string "to navigate" Footer hint after the ↑ ↓ keys.
Select string "to select" Footer hint after the Enter key.
Close string "to close" Footer hint after the Esc key on the root page.
ClearQuery string "to clear" Footer hint after the Esc key in an inline palette with a query typed.
Back string "to go back" Footer hint after the Esc key on a nested page and in a prompt.
OpenActions string "for actions" Footer hint after the Tab key.
Toggle string "to toggle" Footer hint after the Enter key on a multi-select page.
Apply string "to apply" Footer hint after Ctrl+Enter on a multi-select page, and after Enter in a prompt.
Pin string "Pin to top" The action panel entry that pins a command.
Unpin string "Unpin" The action panel entry that unpins a command.
RemoveFromRecents string "Remove from recents" The action panel entry that forgets a command's uses.
ClearRecents string "Clear recent commands" The action panel entry that forgets every recent command (pins stay).
ConfirmPrefix string "Confirm: " Put before the title of a command waiting for its confirming Enter.
ConfirmHint string "Press Enter again to confirm, Esc to cancel" Announced with the confirmation message of a command waiting for its second Enter.
SelectedCount string "{0} selected" How many rows are checked on a multi-select page; {0} is the count.
ResultsAnnouncement string "{0} results available" Announced after a search with several results; {0} is the count. See ResultsAnnouncementFor.
OneResultAnnouncement string "1 result available" Announced after a search with exactly one result.
NoResultsAnnouncement string "No results" Announced after a search with no result.
PageAnnouncement string "{0}. {1}" Announced when a page opens or the palette goes back to one; {0} is its title, {1} what it lists.
Disabled string "Unavailable" Shown when a disabled command without a reason is chosen.
ModeHintTitle string "{0} — {1}" Not used by the palette itself; kept for templates.
DialogLabel string "Command palette" The accessible name of the dialog.
InputLabel string "Search commands" The accessible name of the search box.
CloseButton string "Close" The accessible name of the close button.
BackButton string "Back" The accessible name of the back button.
Breadcrumb string "Breadcrumb" The accessible name of the breadcrumb navigation.
OpenPalette string "Open command palette" What BitCommandPaletteTrigger's accessible name says it does, after its visible label and TriggerNameSeparator (WCAG 2.5.3: the name starts with what is shown), and its whole name when the trigger shows no label. A string that already holds the label - a whole name such as "Search commands" for the label "Search" - is the name on its own, as is a label that already holds this string.
TriggerNameSeparator string ", " What joins BitCommandPaletteTrigger's visible label and OpenPalette in its accessible name; a language with a comma of its own uses it ("، " in Persian and Arabic).
Search string "Search" The label of BitCommandPaletteTrigger when it sets none of its own.
Home string "Home" The title of the root page.
MoreResults string "Show {0} more…" The row that loads a source's next page when it said how many results there are; {0} is how many are left.
LoadMore string "Show more…" The row that loads a source's next page when it did not say how many results there are.
SequencePending string "waiting for the next key…" Shown, and announced, after the first chords of a shortcut sequence (G of G S), until it completes or times out.
CommandFailed string "Couldn’t run “{0}”." Shown when a command failed; {0} is its title. See Message.
CommandRefused string "You can’t run “{0}”." Shown when a guard refused a command without a message of its own (see IBitCommandPaletteCommandGuard); {0} is its title.
CommandUnavailable string "“{0}” is no longer available." Shown when a listed command was chosen after it stopped being available - its VisibleWhen, or an ancestor's, turned false since the list was built; {0} is its title.
LoadFailed string "Couldn’t load this list." Shown when the children of a page failed to load.
Retry string "Try again" The button and hint that load a failed list again.
ApproximateResults string "No exact matches. Showing close ones." Shown above results found only by allowing typos (see TypoTolerance).
ApproximateResultsAnnouncement string "{0} {1}" The announcement of such results: {0} is ApproximateResults, {1} the result count.
Running string "Working…" Announced, and shown by a spinner, while a command's handler has been running for a moment.
SourceFailed string "Couldn’t search {0}" The row an async source that failed or timed out leaves; {0} is its name. Choosing it retries.
On string "On" What screen readers hear for a toggle that is on.
Off string "Off" What screen readers hear for a toggle that is off.
ShortcutThen string "then" The word between the chords of a sequence: "G then S".

BitCommandPaletteOptions properties

The app-wide configuration, set through AddBitBlazorUIExtrasServices(commandPalette: options => ...). The palette's own parameters, and a BitCommandPaletteParams cascaded through a BitParams, override what they share with it.

Name Type Default value Description
ToggleShortcut BitCommandPaletteKeyboardShortcut? BitCommandPaletteKeyboardShortcut.Parse("Mod+K") Shortcut that toggles the palette. Default Mod+K (⌘K on macOS, Ctrl+K elsewhere).
AdditionalToggleShortcuts List<BitCommandPaletteKeyboardShortcut> [] Additional toggle shortcuts (e.g. Ctrl+Shift+P, /).
SuppressShortcutsInEditableElements bool true Don't fire global command shortcuts on a plain key pressed while an input, textarea or contenteditable has focus. A chord with a modifier still fires there, unless the element claims it itself (an editor's Ctrl+K, by preventing its default). False fires on plain keys too, the palette hearing every key ahead of the page.
Loop bool true Wrap around when arrowing past the first/last item.
VimBindings bool false Enable Ctrl+J/Ctrl+K navigation inside the list (Ctrl+N/Ctrl+P are always on).
EnableHistory bool true Track recents and frecency.
HistoryStorageKey string "bit-command-palette.history" localStorage key for BitCommandPaletteBrowserStorageHistoryStore.
GroupWhenSearching bool true Keep group headings while searching (cmdk style). When false, results are a flat ranked list.
GroupOrder List<string> [] Explicit group order. Groups not listed come after, alphabetically.
PriorityWeight double 0.25 Weight of Priority when a query is present (score points per priority unit).
FrecencyWeight double 6 Weight of frecency when a query is present.
SearchNestedCommands bool true Find nested commands from the root page too (default true), as kbar does: typing dark lists "Theme › Dark" without opening Theme first, and theme dark matches the ancestors' titles as well. Only commands registered with the service or declared in markup are found - a lazily loaded page's children do not exist until it opens - and only where every ancestor is visible and enabled and none is a multi-select page. Their recents and pins are listed on the root page as well.
TypoTolerance bool true When a query matches nothing, look again allowing a typo per term - one missing, extra, wrong or swapped letter in a term of 4 to 7 characters, two from 8 on - so settigns still finds "Settings" (default true). Only a query that found nothing is retried, so this never adds noise to one that works; the list says the results are close matches.
ShowSequenceHint bool true After the first chords of a shortcut sequence (G of G S), show and announce that the next key is awaited, as VS Code does in its status bar (default true). SequencePending reports it to code either way.
ShowModeHints bool true Show a "Modes" hint group on the empty query listing registered prefixes.
CloseOnBackdropClick bool true Close when clicking the backdrop.
CloseOnNavigation bool true Close when the app navigates (e.g. a handler called NavigationManager.NavigateTo).
ResetOnClose bool true Reset query and page stack when closed. When false, reopening restores the previous state.
HighlightMatches bool true Highlight matched characters in titles and subtitles.
ShowFooter bool true Show the footer with keyboard hints.
ShowShortcuts bool true Render shortcut hints on rows.
Virtualize bool false Use <Virtualize> for the list (recommended above ~500 rows). Requires fixed RowHeight.
Matcher IBitCommandPaletteMatcher BitCommandPaletteFuzzyMatcher.Default Text matcher used for scoring. Default BitCommandPaletteFuzzyMatcher.
Weights BitCommandPaletteMatchWeights new() Per-field weights for scoring.
Strings BitCommandPaletteStrings new() UI strings. Subclass or set properties to localize.
Commands List<BitCommandPaletteCommand> [] Commands registered at startup.
Modes List<BitCommandPaletteCommandMode> [] Modes registered at startup.
Sources List<IBitCommandPaletteSource> [] Async sources queried in the default mode.
RecordCommandIdsInTraces bool true Whether the bit.command_palette.command activities the palette traces carry the command's id (default true) - see BitCommandPaletteDiagnostics. Turn it off when ids embed personal data, as ids made from an API's records can (person:[email protected]). Metrics never carry ids, and queries, prompt values and titles are never recorded. Off, it also keeps a command's id and title out of the palette's log messages about running it - a failure, a refusal, a guard that threw, an unsafe link - which usually leave through the same pipeline; they read (hidden) instead. The configuration warnings about shortcuts and duplicate ids, which name the commands an app registers, still carry them.
AllowedUrlSchemes HashSet<string> new(StringComparer.OrdinalIgnoreCase) { "http", "https", "mailto", "tel" } The URL schemes a command's Href may use; relative links are always allowed. A link with any other scheme - javascript:, data:, vbscript: - is refused and logged instead of followed, because commands often carry data from an API (see IBitCommandPaletteSource). Default http, https, mailto and tel; compared case-insensitively.
SequenceTimeoutMs int 1000 Milliseconds a multi-chord sequence (G I) waits for the next chord. Must be positive.
DebounceMs int 150 Debounce for async sources, in milliseconds. Must not be negative.
SourceTimeoutMs int 10000 How long an async source may take, in milliseconds, before it counts as failed and its results are replaced by a retry row. 0 waits for ever. Must not be negative.
MaxRecents int 5 How many recent commands to show on the empty query. Must not be negative.
MaxHistoryEntries int 200 Upper bound of history entries kept; pinned commands are never pruned. Must not be negative.
MaxResults int 150 Max rows rendered (groups excluded) for a query. Protects against huge registries. Must be positive.
RowHeight float 44 Row height in pixels used by virtualization. Must be positive.

BitCommandPaletteTrigger properties

A button that opens the modal palette - optionally with a query or on a command's page - and shows its toggle shortcut in the platform's own symbols.

Name Type Default value Description
ChildContent RenderFragment? null Replaces the button's content (icon, label and shortcut hint). Without a Label the button is named by what the content shows, followed by ", Open command palette"; content that shows only an icon sets Label="", so the name does not start with the separator.
Classes BitCommandPaletteTriggerClassStyles? null Custom CSS classes for the different parts of the trigger.
Label string? null The label. Default: "Search"; an empty one shows the icon alone. The button's accessible name starts with it. With ChildContent it is not shown, only named: set it to the text the content shows, or to an empty string for content that shows only an icon, and the button is named as the default one is.
MacKeys bool? null Forces the macOS key symbols on or off. Default: the platform the palette detected.
PageCommandId string? null Opens the palette directly inside the page of the command with this id.
Query string? null Opens the palette with this query (e.g. a mode prefix).
ShowShortcut bool true Shows the toggle shortcut of the palette. Default: true.
Styles BitCommandPaletteTriggerClassStyles? null Custom CSS styles for the different parts of the trigger.

BitCommandPaletteTriggerClassStyles properties

Name Type Default value Description
Root string? null Custom CSS classes/styles for the root element (the button) of the BitCommandPaletteTrigger.
Icon string? null Custom CSS classes/styles for the search icon of the BitCommandPaletteTrigger.
Label string? null Custom CSS classes/styles for the label of the BitCommandPaletteTrigger.
Shortcut string? null Custom CSS classes/styles for the shortcut hint of the BitCommandPaletteTrigger.

BitCommandPaletteOption properties

A command declared in markup inside a BitCommandPalette, directly or in a BitCommandPaletteGroup. Nested options turn it into a page.

Name Type Default value Description
AlwaysShow bool false Listed whatever the query, e.g. for a "couldn't find it?" row.
Badge string? null A small pill at the end of the row, e.g. "New" or "Beta".
Checked bool? null The state of a toggle; renders a switch.
ChildContent RenderFragment? null Nested BitCommandPaletteOptions turn this item into a page.
ChildrenPlaceholder string? null Placeholder for the nested page when this item has child items.
ConfirmMessage string? null Asks for a second Enter before running, showing this message.
Description string? null Longer text for the detail pane. Searched with a low weight.
Destructive bool false Styled as dangerous. With ConfirmMessage, Enter has to be pressed twice.
Disabled bool false Listed but not runnable.
DisabledReason string? null Why the item is disabled; shown instead of the subtitle and when it is selected.
GlobalShortcut bool true Whether Shortcut also fires while the palette is closed. Default true.
Href string? null Navigation target (used when OnExecute is not set).
Icon RenderFragment? null An icon rendered before the title.
IconCss string? null A CSS class for an icon element, e.g. bi bi-house.
Id string? null Stable id. Defaults to a slug of Title.
KeepOpen bool false Keep the palette open after OnExecute.
Keywords string? null Comma or space separated keywords.
Kind BitCommandPaletteCommandKind? null The semantic kind; picks the default icon. Inferred when not set.
MultiSelect bool false Allow checking several children before applying with Ctrl+Enter (calls OnExecute with the selection).
NewTab bool false Open Href in a new tab.
OnExecute EventCallback<BitCommandPaletteCommandContext> Invoked when the item is selected. The palette closes afterwards unless KeepOpen is set.
Priority int? null A ranking nudge; see BitCommandPaletteCommandPriority. Defaults to the group's priority.
Shortcut string? null Shortcut, e.g. Mod+Shift+D or G I.
Subtitle string? null A secondary label next to the title. Searched and highlighted.
Tags string[]? null Free-form labels that modes can scope to; combined with the group's.
Title string string.Empty The label. Searched with the highest weight and highlighted.
Value string? null The current value of a setting, e.g. "Dark".

BitCommandPaletteGroup properties

Groups the BitCommandPaletteOptions declared inside it under one heading.

Name Type Default value Description
ChildContent RenderFragment? null The BitCommandPaletteOptions of the group.
Heading string string.Empty Group heading applied to all BitCommandPaletteOption children.
Priority int? null Priority applied to children that don't set their own.
Tags string[]? null Tags applied to all children (for mode scoping).

BitVisibility enum

Name Value Description
Visible 0 The content of the component is visible.
Hidden 1 The content of the component is hidden, but the space it takes on the page remains (visibility:hidden).
Collapsed 2 The component is hidden (display:none).

BitDir enum

Name Value Description
Ltr 0 Ltr (left to right) is to be used for languages that are written from the left to the right (like English).
Rtl 1 Rtl (right to left) is to be used for languages that are written from the right to the left (like Arabic).
Auto 2 Auto lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element.

Feedback

Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.