SwipeUI

Menu

Open the same action collection from a tap, a hold, an anchored panel or an action sheet.

npx @swipeui/cli add menu
Variant
Preset
Material
Scheme
Feel
Real free component with a browser animation bridge. Native motion, haptics and materials need a device.

When to use it

  • An overflow button (⋯) with options like Edit, Share and Delete.
  • Long-press context menus on items such as photos or messages.
  • Using the system's native menus on iOS and Android with one API.
  • Sort and view options in a toolbar.

When not to use it

  • Use Dropdown to choose a form value.
  • Use Dialog when a decision needs an explanation or retry.
  • Use Glass Menu for a glass-styled trigger.

Installation

Run this from your app's root. If SwipeUI isn't set up yet, run npx @swipeui/cli init first; it sets up Uniwind, the theme tokens and the cn helper.

npx @swipeui/cli add menu
  • Adds components/swipeui/overlay/menu-support.ts, components/swipeui/overlay/menu.tsx and 15 shared helpers.
  • Installs @expo/ui, uniwind, react-native-reanimated, react-native-worklets, clsx, tailwind-merge, expo-haptics, class-variance-authority, react-native-gesture-handler, react-native-safe-area-context, @gorhom/bottom-sheet, expo-blur, react-native-svg. In Expo apps it uses npx expo install so versions match your SDK.

Usage

import { Menu } from '@/components/swipeui/overlay/menu';

<Menu
  mode="anchored"
  triggerLabel="Route actions"
  actions={[
    { id: 'pin', label: 'Pin route', group: 'Organize' },
    { id: 'delete', label: 'Remove from saved', group: 'Manage', destructive: true },
  ]}
  onSelect={handleAction}
/>;
SettingDefaultBehavior
modesystemUse anchored for a custom trigger or grouped rows, and action-sheet for a bottom action list.
activationtapChoose longPress for context actions.
actions, onSelectCaller suppliedGive each action a stable ID. Set disabled and destructive independently.
trigger, align, widthLabel, auto, 240Customize the anchored trigger and panel.
showCancel, messages.cancelOn, CancelConfigure the optional cancel row in the action sheet.
open, defaultOpen, onOpenChangeClosedControl or observe the anchored panel and action sheet. System controls own their presentation on iOS.

See Native Tabs Action for a navigation-specific presentation.

Use description for a short second line and children for nested actions. A parent action opens its group in an elevated panel. Tap the exposed parent, press Escape, or use the submenu's back button to return one level. Selecting a leaf reports its ID. Use side with align to position the anchored panel. clearBackdrop keeps outside dismissal active without a visible scrim. Place SheetProvider in the app's gesture root for the bottom-sheet presentation.

Behavior and gestures

  • Open grouped actions and submenus, optionally from one of four directions.
  • Use the bottom-sheet presentation for a full-width action list.

Accessibility

  • System menus follow the platform focus and dismissal rules.
  • Anchored menus expose menu items and return focus to their trigger.
  • Triggers keep large touch targets.

Motion

  • Uses the press and overlay motion roles, so it follows your app's feel. Pass motion to tune this one instance.
  • System menus use system motion. The anchored panel follows the overlay motion and Reduce Motion.

Performance

  • Menu contents appear when the surface opens.

Notes for AI

  • Choose mode for presentation and activation for tap or hold. Use the anchored presentation for custom triggers and grouped action rows.

Compatibility

Runs onSupported
Expo SDK 57Yes
Expo SDK 58Yes
React Native CLI (with Expo modules)Yes
Expo GoYes
iOSYes
AndroidYes

This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.

Related items