ContextMenu

ContextMenu shows actions for a target on right-click or long-press.

Basics

Wrap any trigger element with ContextMenu and pass an items array. The menu opens on right-click (web) or long-press (mobile); the children render prop receives the handlers to spread onto your trigger.

Loading demo…

import { Card, ContextMenu, Text } from '@plocks/ui'; const ITEMS = [ { id: 'copy', label: 'Copy' }, { id: 'rename', label: 'Rename' }, { id: 'delete', label: 'Delete', danger: true }, ]; export function Demo() { return ( <ContextMenu items={ITEMS}> {(triggerProps) => ( <Card {...triggerProps} padding="2xl"> <Text>Right-click or long-press me</Text> </Card> )} </ContextMenu> ); }
Scan to open this page on your phoneplocks.dev/ui/ContextMenu