Unlock faster development with Fidely UI Pro components Coming soon

Command Input

A non editable, input like trigger for opening command palettes or search dialog. Supports icons, keyboard shortcuts, and custom placeholders

Important Note: As of v2.3.0, we have removed automatic OS detection for keyboard shortcuts. The default shortcut is now strictly ⌘ + K. Support for other modifier keys (such as Alt, Shift or Space) has been removed.

Overview

CommandInput is an input styled trigger used to open command palettes, dialogs, or search surfaces. It does not accept text input directly.

It is commonly used to:

  • Open command palettes (⌘K / Ctrl+K)

  • Trigger global search dialogs

  • Act as a combobox or dialog entry point

Usage

import { CommandInput } from '@fidely-ui/react'
<CommandInput />

When the user clicks the component or presses the configured keyboard shortcut, the onOpen callback is invoked.

With Custom Icon

You can replace the default search icon using the leftElement prop.

Use with Dialog & Combobox

CommandInput is typically paired with a dialog and combobox for search UI.

Custom Keyboard Shortcut

You can override the default shortcut (⌘ + K) using the shortcut prop.

Props

CommandInput

PropTypeDefaultDescription
placeholderstring"Search..."Placeholder text shown inside the input trigger..
shortcutstring"⌘K" (Mac) / "Ctrl+K" (Windows)Keyboard shortcut that triggers the command action.
onOpen() => voidCallback fired when the input or keyboard shortcut is activated.
isOpenbooleanfalseControls the active/open visual state of the trigger.
size'sm' | 'md' | 'lg'mdThe size of the CommandInput component
leftElementReactNode<SearchIcon />Element rendered at the start of the input trigger.
aria-labelstring-Optional. Overrides the accessible name of the button. Required only if visible text is removed or hidden.