EnhanceCommandOptions: {
    closeOnCommand?: boolean;
    defaultOpen?: boolean;
    defaultValue?: string;
    hotkey?: string;
    onCommand?: (value: string, item: HTMLElement) => void;
    onOpenChange?: (open: boolean) => void;
    onValueChange?: (value: string) => void;
}

Options for enhanceCommand.

Type declaration

  • OptionalcloseOnCommand?: boolean

    Close the hosting <dialog> after a command runs. Defaults to true.

  • OptionaldefaultOpen?: boolean

    Open the hosting <dialog> immediately on enhance. Defaults to false.

  • OptionaldefaultValue?: string

    Initial filter query; pre-fills the input.

  • Optionalhotkey?: string

    Lowercased key that, with Cmd/Ctrl, opens the palette's hosting <dialog>.

  • OptionalonCommand?: (value: string, item: HTMLElement) => void

    Called with the command's value when a command runs.

  • OptionalonOpenChange?: (open: boolean) => void

    Called after the hosting <dialog> opens or closes.

  • OptionalonValueChange?: (value: string) => void

    Called with the filter query after every change.