PopupMenu
Installation
Section titled “Installation”npm install @sk-web-gui/reactAnvändning
Section titled “Användning”import { PopupMenu } from '@sk-web-gui/react';| Prop | Typ | Standard | Beskrivning |
|---|---|---|---|
children | | [React.ReactComponentElement<typeof PopupMenuButton>, React.ReactComponentElement<typeof PopupMenuPanel>] | React.ReactComponentElement<typeof PopupMenuPanel> | – | PopupMenu.Button & PopupMenu.Panel |
id | string | – | |
open | boolean | – | Set true to open the menu @default false |
onToggleOpen | (open: boolean) => void | – | Returns 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 |
autoAlign | boolean | – | This will flip the alignment if the panel doesn’t fit on screen @default true |
autoPosition | boolean | – | This will flip the position (under and over, left and right) if the panel doesn’t fit on screen @default false |
Standardargs (från Meta.args)
Section titled “Standardargs (från Meta.args)”{ "position": "under", "autoPosition": false}Storyvarianter
Section titled “Storyvarianter”- Template – standardstory
- CheckboxesAndFilter – standardstory
- PopupMenuAsDialog – standardstory
- Implementation: @sk-web-gui/popup-menu
- Storybook: PopupMenu