Hoppa till innehåll

PopupMenu

Terminal window
npm install @sk-web-gui/react
import { PopupMenu } from '@sk-web-gui/react';
PropTypStandardBeskrivning
children| [React.ReactComponentElement<typeof PopupMenuButton>, React.ReactComponentElement<typeof PopupMenuPanel>] | React.ReactComponentElement<typeof PopupMenuPanel>PopupMenu.Button & PopupMenu.Panel
idstring
openbooleanSet true to open the menu @default false
onToggleOpen(open: boolean) => voidReturns true or false when menu is opened or closed
size'md' | 'sm'Size of popup. Does not affect button size @default md
position'under' | 'over' | 'left' | 'right'Position of the popup relative to the button. @default under
align'start' | 'end'Alignment of the popup relative to the button. @default start
type'dialog' | 'menu'Type of popup. @default menu
autoAlignbooleanThis will flip the alignment if the panel doesn’t fit on screen @default true
autoPositionbooleanThis will flip the position (under and over, left and right) if the panel doesn’t fit on screen @default false
{
"position": "under",
"autoPosition": false
}
  • Template – standardstory
  • CheckboxesAndFilter – standardstory
  • PopupMenuAsDialog – standardstory