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-menuUsage
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
| Prop | Type | Default |
|---|---|---|
triggerContent 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[] | โ |
closeOnSelectClose after a row or action is pressed. | boolean | true |
widthMenu width. | number | 260 |
offsetDistance from the parent's bottom-right corner. | { bottom?, right? } | { 40, 20 } |
staggerDelay (ms) between rows. | number | 45 |
surfaceColorRow and button colour. | string | "#2a2a2a" |
highlightColorColour of highlighted rows. | string | "#5a5a5a" |
textColorRow label colour. | string | "#fff" |