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';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
trigger | ReactElement | A single focusable element, usually a Button. Receives the menu-button ARIA and handlers. Or DropdownMenu.Trigger. | |
items | MenuItem[] | Menu rows: actions (with optional submenus), checkboxes, radio groups, separators and labels. Or compose them as children: DropdownMenu.Item, .CheckboxItem, .Label, .Separator. | |
children | ReactNode | The compound form: a DropdownMenu.Trigger and the rows, instead of trigger and items. | |
open | boolean | Controlled open; use with onOpenChange. | |
defaultOpen | boolean | false | Initial open when uncontrolled. |
onOpenChange | (open: boolean) => void | Called with the new open when it changes. | |
placement | Placement | '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. | |
className | string | Class 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 · Весь раздел «Навигация и каркас»