5.0.1 • Published 1 year ago

@paprika/overflow-menu v5.0.1

Weekly downloads
16
License
MIT
Repository
github
Last release
1 year ago

@paprika/overflow-menu

Description

OverflowMenu component displays a trigger button, which when clicked displays a list of items in a dropdown menu format. These items can be raw content, Links or actions such as Delete, which will prompt a confirmation panel to be displayed.

Installation

yarn add @paprika/overflow-menu

or with npm:

npm install @paprika/overflow-menu

Props

OverflowMenu

PropTyperequireddefaultDescription
align Popover.types.align.TOP, Popover.types.align.RIGHT, Popover.types.align.BOTTOM, Popover.types.align.LEFTfalsePopover.types.align.BOTTOMWhere the popover content is positioned relative to the trigger or getPositioningElement.
childrennodetrue-Children should consist of <OverflowMenu.Item />
edge Popover.types.align.LEFT, Popover.types.align.RIGHT, nullfalsenullIf provided, will align Popover to specified edge of Trigger
isOpenboolfalsenullControl if the overflow menu popover open.
maxHeightnumber,stringfalse300The maximum height of the OverflowMenu content
onClosefuncfalsenullIf provided, will fire when the Popover is closed
zIndexnumberfalsezValue(1)The z-index for the popover / confirmation

OverflowMenu.Item

PropTyperequireddefaultDescription
childrennodetrue-HTML for each item
isDestructiveboolfalsefalseIf the item is destructive.
onClickfuncfalse() => {}Callback to be executed when button is clicked
onKeyDownfuncfalse() => {}Callback to be executed when key is pressed
onClosefuncfalse() => {}Callback to be executed when overflow menu needs to be closed
onShowConfirmationfuncfalse() => {}Callback to be executed when delete item is clicked
renderConfirmationfuncfalsenullRender prop to render the replacement node

OverflowMenu.LinkItem

PropTyperequireddefaultDescription
childrennodetrue-HTML for each LinkItem
linkstringtrue-The url for the href
onKeyDownfuncfalse() => {}Callback to be executed when key is pressed
isExternalboolfalsefalseShould the link open content in a new tab

OverflowMenu.Trigger

PropTyperequireddefaultDescription
childrennodefalsenull
buttonType Trigger.types.button.ICON, Trigger.types.button.RAW, Trigger.types.button.SIMPLEfalseTrigger.types.button.SIMPLEDetermine the styling of the button
isOpenboolfalsefalse
menuRefIdstringfalse""
onClickfuncfalse() => {}
onOpenMenufuncfalse() => {}
triggerRefcustomfalsenull

Usage

import OverflowMenu from "@paprika/overflow-menu";
import Confirmation from "@paprika/confirmation";

<OverflowMenu>
  <OverflowMenu.Trigger>Trigger</OverflowMenu.Trigger>
  <OverflowMenu.Content className="my-popover-classname" />
  <OverflowMenu.Item onClick={() => {}}>Edit</OverflowMenu.Item>
  <OverflowMenu.LinkItem isExternal link="http://www.wegalvanize.com">
    External link
  </OverflowMenu.LinkItem>
  <OverflowMenu.Item isDisabled onClick={() => {}}>
    Disabled Item
  </OverflowMenu.Item>
  <OverflowMenu.Divider />
  <OverflowMenu.Item
    isDestructive
    renderConfirmation={onCloseMenu => {
      return (
        <Confirmation
          body="Lorem ipsum dolor amet vexillologist tacos selvage narwhal butcher twee ethical hot chicken."
          confirmLabel="Delete filter"
          defaultIsOpen
          heading="Delete filter?"
          onConfirm={handleConfirm}
          onClose={handleCloseConfirm(onCloseMenu)}
        />
      );
    }}
  >
    Delete filter
  </OverflowMenu.Item>
</OverflowMenu>;

Links

5.0.1

1 year ago

5.0.1-next.0

1 year ago

5.0.0

1 year ago

5.0.0-next.0

1 year ago

4.0.1

2 years ago

4.0.0

2 years ago

4.0.0-next.0

2 years ago

4.0.1-next.0

2 years ago

3.0.4-next.0

2 years ago

3.0.4

2 years ago

3.0.3

3 years ago

3.0.3-next.0

3 years ago

3.0.2-next.0

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0-next.0

3 years ago

3.0.0

3 years ago

3.0.1-next.0

3 years ago

2.0.7

3 years ago

2.0.9

3 years ago

2.0.8

3 years ago

2.0.7-next.0

3 years ago

2.0.9-next.0

3 years ago

2.0.8-next.1

3 years ago

2.0.8-next.0

3 years ago

2.0.6-next.2

3 years ago

2.0.6-next.1

3 years ago

2.0.6-next.0

3 years ago

2.0.6

3 years ago

2.0.5

3 years ago

2.0.5-next.0

3 years ago

2.0.5-next.1

3 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.4

4 years ago

2.0.4-next.0

4 years ago

2.0.2-next.0

4 years ago

2.0.3-next.2

4 years ago

2.0.3-next.1

4 years ago

2.0.3-next.0

4 years ago

2.0.3-next.3

4 years ago

2.0.0-next.1

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

2.0.1-next.0

4 years ago

2.0.0-next.0

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.8-next.0

4 years ago

1.1.9-next.0

4 years ago

1.1.7

4 years ago

1.1.7-next.0

4 years ago

1.1.6

4 years ago

1.1.6-next.0

4 years ago

1.1.5

4 years ago

1.1.5-next.0

4 years ago

1.1.4

4 years ago

1.1.4-next.0

4 years ago

1.1.3

4 years ago

1.1.3-next.0

4 years ago

1.1.2

4 years ago

1.1.2-next.0

4 years ago

1.1.1

4 years ago

1.1.1-next.0

4 years ago

1.1.0

4 years ago

1.1.0-next.0

4 years ago

1.0.19

4 years ago

1.0.19-next.0

4 years ago

1.0.20-next.0

4 years ago

1.0.20

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.18-next.0

4 years ago

1.0.17-next.0

4 years ago

1.0.16-next.0

4 years ago

1.0.16-next.1

4 years ago

1.0.15

4 years ago

1.0.15-next.0

4 years ago

1.0.14

4 years ago

1.0.14-next.0

4 years ago

1.0.13

4 years ago

1.0.13-next.0

4 years ago

1.0.12

4 years ago

1.0.12-alpha.3

4 years ago

1.0.12-alpha.2

4 years ago

1.0.12-alpha.1

4 years ago

1.0.12-alpha.0

4 years ago

1.0.11

4 years ago

1.0.11-alpha.0

4 years ago

1.0.10

4 years ago

1.0.10-alpha.0

4 years ago

1.0.9

4 years ago

1.0.9-alpha.0

4 years ago

1.0.8

4 years ago

1.0.8-alpha.0

4 years ago

1.0.7

4 years ago

1.0.7-alpha.0

4 years ago

1.0.6

5 years ago

1.0.6-alpha.1

5 years ago

1.0.6-alpha.0

5 years ago

1.0.5

5 years ago

1.0.5-alpha.1

5 years ago

1.0.5-alpha.0

5 years ago

1.0.4

5 years ago

1.0.4-alpha.2

5 years ago

1.0.4-alpha.1

5 years ago

1.0.4-alpha.0

5 years ago

1.0.3

5 years ago

1.0.3-alpha.1

5 years ago

1.0.3-alpha.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.1-alpha.1

5 years ago

1.0.1-alpha.0

5 years ago