ValyroUI English version

Dropdown Menu

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

Установка

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

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

Пропсы

PropTypeDefault
triggerReactElementA single focusable element, usually a Button. Receives the menu-button ARIA and handlers. Or DropdownMenu.Trigger.
itemsMenuItem[]Menu rows: actions (with optional submenus), checkboxes, radio groups, separators and labels. Or compose them as children: DropdownMenu.Item, .CheckboxItem, .Label, .Separator.
childrenReactNodeThe compound form: a DropdownMenu.Trigger and the rows, instead of trigger and items.
openbooleanControlled open; use with onOpenChange.
defaultOpenbooleanfalseInitial open when uncontrolled.
onOpenChange(open: boolean) => voidCalled with the new open when it changes.
placementPlacement'bottom-start'Preferred side and alignment relative to the trigger; flips when there is no room.
animation'pop' | 'spring'pop (default): the theme's enter. spring: the menu and its submenus spring open and one highlight glides between rows.
classNamestringClass for the menu surface.

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

DropdownMenu.Trigger (DropdownMenuTrigger), DropdownMenu.Item (DropdownMenuItem), DropdownMenu.CheckboxItem (DropdownMenuCheckboxItem), DropdownMenu.Label (DropdownMenuLabel), DropdownMenu.Separator (DropdownMenuSeparator)

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

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

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