ValyroUI English version

Command Palette

Меню команд в стиле ⌘K. Бесплатно, MIT · Навигация и каркас › Меню и команды

Установка

npx valyro-cli@latest add command-palette
npx shadcn@latest add https://valyro.xyz/r/command-palette.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { CommandPalette } from 'valyro-ui';

Пропсы

PropTypeDefault
commandsCommandPaletteItem[]Searchable commands, listed under their group headings and filtered by label and keywords. Or compose them as children: CommandPalette.Group and CommandPalette.Item.
childrenReactNodeThe compound form instead of commands: CommandPalette.Item elements, alone or in CommandPalette.Groups.
openbooleanControlled open state of the modal palette. Ignored when inline.
defaultOpenbooleanfalseInitial open state when uncontrolled. Ignored when inline.
onOpenChange(open: boolean) => voidCalled when the modal palette opens or closes.
inlinebooleanfalseRender the palette in the page flow instead of a modal: always open, no scrim or focus trap, Escape clears the query. For a command menu embedded in a page or a panel (a launcher, a search page).
placeholderstring'Type a command or search…'Placeholder of the search field.
renderEmpty(query: string) => ReactNode(query) => (query ? `No results for “${query}”` : 'No commands')Shown when nothing matches; receives the trimmed query.
labelsPartial<CommandPaletteLabels>Overrides for the built-in English strings.

Составные части

CommandPalette.Item (CommandPaletteItemPart), CommandPalette.Group (CommandPaletteGroup)

Похожие компоненты

  • Dropdown Menu — Выпадающее меню
  • Context Menu — Контекстное меню
  • Keyboard Map Overlay — Карта горячих клавиш экрана: поиск, клавиатура и режим тренировки
  • App Shell — Каркас приложения
  • Navbar — Верхняя навигация
  • Sidebar — Боковая панель
  • Resizable Panels — Панели с изменяемым размером
  • Breadcrumbs — Хлебные крошки
  • Tabs — Вкладки
  • Segmented Control — Переключатель режимов
  • Pagination — Постраничная навигация
  • Stepper — Пошаговые процессы

Назад: Context Menu · Далее: Keyboard Map Overlay · Весь раздел «Навигация и каркас»