Set up the kbar UI components
mainTo render the command palette UI, use the provided component hierarchy inside KBarProvider. This structure ensures the menu is rendered outside the root node and handles animations and positioning.
Required components:
KBarPortal: Renders the content outside the root node.KBarPositioner: Centers the content.KBarAnimator: Handles show/hide and height animations.KBarSearch: The search input field.
import {
KBarProvider,
KBarPortal,
KBarPositioner,
KBarAnimator,
KBarSearch
} from "kbar";
// Inside your component return:
<KBarProvider actions={actions}>
<KBarPortal>
<KBarPositioner>
<KBarAnimator>
<KBarSearch />
</KBarAnimator>
</KBarPositioner>
</KBarPortal>
<MyApp />
</KBarProvider>