reablocks
Version:
Component library for React
48 lines (46 loc) • 1.14 kB
TypeScript
import { CommandPaletteTheme } from './CommandPaletteTheme';
import { HotkeyIem } from './useFlattenedTree';
import { FC, PropsWithChildren, ReactNode } from 'react';
export interface CommandPaletteProps extends PropsWithChildren {
/**
* Search input value.
*/
search?: string;
/**
* Placeholder text.
*/
placeholder?: string;
/**
* Selected Index.
*/
selected?: number;
/**
* Autofocus or not.
*/
autoFocus?: boolean;
/**
* Empty message to show when there are no items.
*/
emptyMessage?: string;
/**
* Icon to show in the search input.
*/
inputIcon?: ReactNode;
/**
* When the search input value changes.
*/
onSearchChange?: (value: string) => void;
/**
* When a user picks something from the list.
*/
onSelectedIndexChange?: (value: number) => void;
/**
* When a hotkey was triggered.
*/
onHotkey?: (hotkey: HotkeyIem) => void;
/**
* Theme for the CommandPalette.
*/
theme?: CommandPaletteTheme;
}
export declare const CommandPalette: FC<CommandPaletteProps>;