ComponentsEnterpriseCommandBar

CommandBar

CommandBar provides fast, searchable access to enterprise actions and destinations.

⌘ / Ctrl KGrouped commandsActive descendantOverlay + inline3 widths

Overview

Use CommandBar to help experienced and keyboard-oriented users find and execute actions without navigating through several interface layers.

Workspace commands

Live preview

Search the command set or use Arrow keys to change the active result.

Workspace commands

Actions
Create projectStart a new enterprise project⌘N
Invite peopleAdd members to this workspace
Navigate
Workspace settingsManage security and defaultsGS
Audit reportsReview governance activity
↑↓ Navigate↵ Run4 commands

Selected: Try a command

WorkspaceCommands.tsx
tsx
import { CommandBar, type CommandBarCommand } from 'omverse-ui'
 
const commands: CommandBarCommand[] = [
{
"id": "create",
"label": "Create project",
"group": "Actions",
"description": "Start a new enterprise project",
"icon": "plus",
"shortcut": [
"⌘",
"N"
]
},
{
"id": "invite",
"label": "Invite people",
"group": "Actions",
"description": "Add members to this workspace",
"icon": "users"
},
{
"id": "settings",
"label": "Workspace settings",
"group": "Navigate",
"description": "Manage security and defaults",
"icon": "settings",
"shortcut": [
"G",
"S"
]
},
{
"id": "audit",
"label": "Audit reports",
"group": "Navigate",
"description": "Review governance activity",
"icon": "file-text"
}
]
 
<CommandBar
commands={commands}
mode="inline"
title="Workspace commands"
placeholder="Search commands..."
onCommandSelect={(command) => {
console.log(`Selected: ${command.label}`)
}}
/>

Anatomy

CommandBar combines a named search field, grouped results, active command, shortcut hints, and keyboard guidance.

⌕Search commands…⌘ K
Actions

Create projectStart a new enterprise project⌘ N

Navigate

Workspace settings

↑↓ Navigate↵ Run
12345
  1. 1
    Command search

    Filters the command set while retaining keyboard focus.

  2. 2
    Command group

    Organizes related actions and destinations under a short heading.

  3. 3
    Active command

    Identifies the result that Enter will execute.

  4. 4
    Shortcut hint

    Teaches a direct keyboard path for a familiar command.

  5. 5
    Keyboard guidance

    Summarizes navigation and execution keys.

When to use

Use CommandBar when an application has many actions or destinations that experienced users need to reach quickly.

Recommended

  • Accelerate broad workflows

    Search commands across projects, people, settings, reports, and navigation.

  • Support keyboard-first work

    Offer a global shortcut and predictable result navigation.

  • Expose contextual commands

    Build the command set from current permissions, selection, and workspace state.

When not to use

CommandBar should complement discoverable navigation and controls, not replace them.

Avoid

  • Do not hide primary actions

    Keep frequent and critical actions visible in Toolbar or page content.

  • Do not use for value selection

    Use Combobox when the result becomes a form value.

  • Do not overload novice workflows

    Maintain ordinary navigation and contextual help alongside commands.

Variants

Mode and width adapt CommandBar to global command palettes and embedded workspace search.

Overlay

Provides a modal global command surface with focus containment.

Inline

Embeds command search within a page or productivity workspace.

Grouped

Separates actions, navigation, records, and other command families.

Widths

Small, medium, and large accommodate command metadata.

States

CommandBar coordinates visibility, query, active result, execution availability, progress, and empty feedback.

StateTriggerVisual responseInteraction
ClosedPalette is inactiveNo overlay surfaceGlobal shortcut opens
OpenShortcut or trigger activatesSearch and grouped commandsInput receives focus
ActiveKeyboard or pointer movementTonal row highlightEnter executes
Disabled commandAction is unavailableReduced emphasisCannot execute
LoadingCommands are resolvingProgress and loading messageQuery remains visible
EmptyNo command matchesNo-command messageQuery remains editable

Behavior

CommandBar owns discovery and invocation mechanics while applications own command availability, authorization, navigation, and side effects.

Global shortcut

Command/Ctrl+K toggles the overlay without entering text.

Active descendant

Focus stays in search while results are navigated.

Filtering

Default matching covers labels, descriptions, groups, and keywords.

Execution

Enter runs the active enabled command and normally closes the palette.

Accessibility

Overlay CommandBar is a named modal dialog containing an editable combobox and grouped listbox with active-descendant navigation.

KeyAction
⌘KOpens or closes the global command surface.
↑↓Moves the active command.
HomeEndMoves to the first or last result.
EnterExecutes the active enabled command.
EscCloses and returns focus.
TabCycles through focusable overlay controls.
  • Give the command surface and result list concise names.
  • Keep DOM focus in the search input during result navigation.
  • Expose the active command with aria-activedescendant.
  • Announce disabled commands without allowing execution.
  • Trap and return focus in overlay mode.
  • Show shortcut hints as supplemental text, never the only label.

Content guidelines

Command labels should describe an immediate result and remain distinguishable when removed from their original screen.

Start with a verb

Name executable commands by their outcome.

ExampleCreate project

Name destinations

Use destination titles for navigation commands.

ExampleWorkspace settings

Add concise context

Use descriptions to distinguish similar commands.

ExampleManage security and defaults

Group by intent

Use short parallel headings.

ExampleActions, Navigate

Examples

Controlled query and filtering support server-ranked or permission-aware command sets.

Interactive command menu

Live preview

Try filtering the realistic grouped command set.

Workspace commands

Actions
Create projectStart a new enterprise project⌘N
Invite peopleAdd members to this workspace
Navigate
Workspace settingsManage security and defaultsGS
Audit reportsReview governance activity
↑↓ Navigate↵ Run4 commands

Selected: Try a command

ControlledCommands.tsx
tsx
<CommandBar
commands={commands}
inputValue={query}
onInputValueChange={setQuery}
filterCommand={(command, value) => command.label.toLowerCase().includes(value.toLowerCase())}
loading={isLoading}
onCommandSelect={trackCommand}
mode="inline"
/>

Props / API

CommandBar extends div attributes; CommandBarCommand defines identity, content, grouping, discovery keywords, availability, shortcut hints, and execution.

Props

PropTypeDefaultDescription
commandsreadonly CommandBarCommand[]requiredCommands available for search and execution.
openbooleanundefinedControlled visibility.
defaultOpenbooleanfalseInitial uncontrolled visibility.
onOpenChange(open: boolean) => voidundefinedRuns whenever visibility changes.
inputValuestringundefinedControlled search query.
defaultInputValuestring''Initial uncontrolled query.
onInputValueChange(value: string) => voidundefinedRuns whenever the query changes.
titlestring'Command menu'Accessible title for the command surface.
placeholderstring'Search commands…'Search prompt.
onCommandSelect(command) => voidundefinedRuns after an enabled command is selected.
filterCommand(command, query) => booleanbuilt-in text matchCustom command filtering logic.
loadingbooleanfalseShows asynchronous command progress.
emptyStateReactNode'No commands found.'Content shown when no command matches.
closeOnSelectbooleantrueCloses after command execution.
hotkeybooleantrueEnables the global Command/Ctrl+K shortcut.
returnFocusRefRefObject<HTMLElement>previous focusElement focused after an overlay closes.
mode'overlay' | 'inline''overlay'Chooses modal palette or embedded search.
size'sm' | 'md' | 'lg''md'Controls maximum command surface width.