Skip to content
Components
/
Context Menu
Dark

Context Menu

Context Menu reveals the actions for one object on press and hold, without leaving the screen.

Preview

Actions for one specific object, raised by press and hold. Press a row to see it fill. On iOS this is .contextMenu; on Android a long press opening a DropdownMenu.

Context Menu, Slot False
300 x 307, padding 8, gap 2, radius 32

307 is arithmetic: 8 of padding, five 56 rows, five 2 gaps, the 1 separator, 8 again. Every row carries the same share-2 icon because Icon Swap sits at its default on all five. Swap it per row.

Item

The building block behind every row, not for direct use. Four states, and only one paints a fill.

State Default, Pressed, Destructive, Disabled
284 x 56, padding 6 and 16, gap 12, radius 24
PressedDestructiveDisabled

Default carries no fill, so a row is invisible until pressed. Pressed takes bg/weak-50. Destructive takes state/error/base-500 on both halves and belongs last, under a separator. Disabled takes fg/disabled-400 and text/disabled-400, which resolve to the same primitive in both modes.

Preview slot

One boolean axis. Slot True raises the pressed object above the menu, which is the iOS convention and reads well on both platforms.

Slot True
160 plus 8 plus 307 = 475
Preview slot, 300 x 160

The slot ships empty, so the page marks the space rather than invent the object that would fill it. The menu below is shortened here; the slot and the gap are the file's, 160 and 8.

Properties

One axis on the published component and a slot. The rest sit on the item inside it, a building block the file marks as not for direct use.

Property
Type
Default
Slot
False | True
False
Preview
Slot, 300 x 160
empty
State
Default | Pressed | Destructive | Disabled, on the item
Default
Label Text
Text, on the item
Menu item
Icon Swap
Instance swap, the Icons set, on the item
share-2

Context Menu ships 2 variants, the item ships 4. The menu composes five items and a separator, so a change to the item reaches every row of both variants.

Tokens

Every value the component reads, resolved through its aliases to the Foundations primitive.

Token
Light
Dark
Applied to
bg/white-0
#FFFFFF
#0E0E0F
The menu surface
border/soft-100
#E9E9EA
#2F2F31
1px inside stroke, and the separator
bg/weak-50
#F4F5F5
#242427
Pressed row
text/strong-950
#0E0E0F
#FFFFFF
Label
fg/sub-700
#48484A
#C7C7CC
Icon
state/error/base-500
#FB2C36
#E7000B
Destructive label and icon
text/disabled-400
#AEAEB2
#8E8E93
Disabled label
fg/disabled-400
#AEAEB2
#8E8E93
Disabled icon

The shadow is the effect style dropShadow/lg: 0 12 18 at minus 3 on black at 8 percent, over 0 5 6 at minus 5 on black at 5 percent. Geometry runs on dimensions/radius/3xl 32 for the menu and dimensions/radius/2xl 24 for the row, with dimensions/spacing/2 8, dimensions/spacing/0-5 2, dimensions/spacing/4 16, dimensions/spacing/3 12 and dimensions/spacing/1-5 6.

Guidelines

Do
ShareRename
Delete

Put the destructive action last, below a separator, and cap the menu at about seven rows.

Don't
DeleteShareRename

Do not open with the destructive row, and do not let this menu be the only way to reach an action. Press and hold is not discoverable, so everything here must also exist somewhere visible.

The menu belongs to one object, not to the screen. Actions that apply to the whole view belong in a toolbar or an action sheet.