UIR

PopoverMenu

A corner button that turns into a menu. Rows spring out one after another and fold back into the button when closed. Tap outside to close.

Preview

Installation

npx @codewithrabby/ui@latest add popover-menu

Usage

import { PopoverMenu } from "@/components/uir/popover-menu";

<View style={{ flex: 1 }}>
  {/* your screen content */}
  <PopoverMenu
    trigger={<MenuIcon color="white" size={20} />}
    items={[
      { label: "Contents", icon: <List color="white" size={18} />, highlighted: true },
      { label: "Search", icon: <Search color="white" size={18} />, onPress: openSearch },
    ]}
    actions={[{ key: "share", icon: <Share color="white" size={18} /> }]}
  />
</View>

Props

PropTypeDefault
trigger

Content of the closed button, e.g. an icon.

ReactNodeโ€”
items

{ label, icon?, highlighted?, onPress? } rows.

PopoverMenuItem[]โ€”
actions

{ key, icon, onPress? } square buttons under the rows.

PopoverMenuAction[]โ€”
closeOnSelect

Close after a row or action is pressed.

booleantrue
width

Menu width.

number260
offset

Distance from the parent's bottom-right corner.

{ bottom?, right? }{ 40, 20 }
stagger

Delay (ms) between rows.

number45
surfaceColor

Row and button colour.

string"#2a2a2a"
highlightColor

Colour of highlighted rows.

string"#5a5a5a"
textColor

Row label colour.

string"#fff"