🎨 Command

Command palette component.

1. Import:

import { Command } from "superkey";

2. Use:

<Command open={true} onClose={() => {}}>
  {/* Here your CommandInput, CommandList or CommandOption */}
</Command>

⚙️ Props:

PropDescriptionRequired
childrenInside it uses the input, list and options components.
openOpen or close the command palette.
onCloseFunction to be executed when close the command palette.
commandFunctionFunction to be executed when click an option.-
afterLeaveFunction to be executed after close the command palette.-
classNameClass to be added to the command palette.-
overlayClassNameClass to be added to the overlay.-

⚙️ Interface:

export interface SharedCommandProps {
  className?: string;
}

export interface CommandProps extends SharedCommandProps {
  children: React.ReactNode;
  open: boolean;
  overlayClassName?: string;
  commandFunction?: FormEventHandler<HTMLFormElement> | (() => void);
  onClose: (value: boolean) => void;
  afterLeave?: () => void;
}