> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Menu & Options

> Add, replace or extend the context-menu and swipe actions of CometChat iOS UI Kit v6 components, the message menu, and the composer's attachment options, in SwiftUI and UIKit.

Components offer actions on a row or a message — a long press, and on lists a swipe. You can
replace all of them or append your own.

***

## options vs addOptions

| | SwiftUI | UIKit | Behaviour |
| - | - | - | - |
| Replace | `options:` | `set(options:)` | your list replaces the built-in actions |
| Append | `addOptions:` | `set(addOptions:)` (Conversations) / `add(options:)` (other lists) | your list is added after the built-ins |

Reach for append to keep the defaults — Delete, Pin — and add your own; replace for full control.

***

## Adding Custom Options

> [tab] SwiftUI
>
> `MenuOption` is a value — `id`, `title`, an SF Symbol name, `isDestructive`. The choice
> arrives at `onOptionSelected` with the SDK object:
>
> ```swift theme={null}
> CometChatConversations(
>     addOptions: { conversation in
>         [MenuOption(id: "archive", title: "Archive", systemImage: "archivebox")]
>     },
>     onOptionSelected: { conversation, option in
>         if option.id == "archive" { open(conversation) }
>     }
> )
> ```

> [tab] UIKit
>
> `CometChatConversationOption` carries its own `onClick`. The same list
> drives **both** the swipe actions and the long-press menu:
>
> ```swift theme={null}
> conversations.set(addOptions: { conversation, indexPath in
>     [CometChatConversationOption(id: "archive", title: "Archive",
>                                  icon: UIImage(systemName: "archivebox")) { conversation, _ in
>         archive(conversation)
>     }]
> })
> ```

![Conversations context menu showing custom actions appended below the built-in ones](https://mintcdn.com/cometchat-22654f5b/pWDsskjSUHgot30F/images/ui-kit/ios/v6/override-addOptions.png?fit=max\&auto=format\&n=pWDsskjSUHgot30F\&q=85\&s=fe744eb31f2a312facea4d8fdb3461c3)

addOptions — appended to defaults

![Conversations context menu showing only custom actions, replacing the built-in ones](https://mintcdn.com/cometchat-22654f5b/pWDsskjSUHgot30F/images/ui-kit/ios/v6/override-options.png?fit=max\&auto=format\&n=pWDsskjSUHgot30F\&q=85\&s=2174a6ebbc6e80c97128a3fd579332cd)

options — defaults replaced

***

## Replacing All Options

> [tab] SwiftUI
>
> ```swift theme={null}
> CometChatConversations(
>     options: { conversation in
>         [
>             MenuOption(id: "archive", title: "Archive", systemImage: "archivebox"),
>             MenuOption(id: "mute", title: "Mute", systemImage: "bell.slash"),
>             MenuOption(id: "leave", title: "Leave", systemImage: "rectangle.portrait.and.arrow.right",
>                        isDestructive: true)
>         ]
>     },
>     onOptionSelected: { conversation, option in print(option.id) }
> )
> ```

> [tab] UIKit
>
> ```swift theme={null}
> conversations.set(options: { conversation, indexPath in
>     [
>         CometChatConversationOption(id: "archive", title: "Archive",
>                                     icon: UIImage(systemName: "archivebox")) { conversation, _ in
>             archive(conversation)
>         },
>         CometChatConversationOption(id: "pin", title: "Pin",
>                                     icon: UIImage(systemName: "pin")) { conversation, _ in
>             pin(conversation)
>         }
>     ]
> })
> ```
>
> The built-ins' ids are `CometChatConversationOption.deleteID`, `.pinID` and `.unpinID`.

> [!WARNING]
>
> A context menu claims the long press, so `onItemLongClick` fires only when no menu is
> configured.

***

## Option Properties

> [tab] SwiftUI
>
> `MenuOption`:
>
> | Property | Type | Description |
> | - | - | - |
> | `id` | `String` | identifies the choice in `onOptionSelected` |
> | `title` | `String` | the label |
> | `systemImage` | `String?` | an SF Symbol name |
> | `isDestructive` | `Bool` | draws the action in red |

> [tab] UIKit
>
> `CometChatConversationOption` (and `CometChatUserOption`, `CometChatGroupOption`,
> `CometChatCallOption`):
>
> | Property | Type | Description |
> | - | - | - |
> | `id` | `String` | unique identifier |
> | `title` | `String?` | the label |
> | `icon` | `UIImage?` | the icon |
> | `titleColor`, `titleFont` | `UIColor?`, `UIFont?` | the label's look |
> | `iconTint`, `backgroundColor` | `UIColor?` | the swipe action's look |
> | `isDestructive` | `Bool` | a red swipe action and a destructive menu item |
> | `onClick` | closure | receives the SDK object and the index path |

***

## Message Options

A long press on a message opens its menu. The same replace / append pair applies.

> [tab] SwiftUI
>
> A `MessageOption` with its own `onClick` runs that **instead of** the list's handling:
>
> ```swift theme={null}
> CometChatMessageList(
>     group: group,
>     addOptions: { message in
>         [MessageOption(id: "forward", title: "Forward", icon: .system("arrowshape.turn.up.right"),
>                        onClick: { forward(message) })]
>     }
> )
> ```
>
> Hide a built-in with its flag — `hideReplyInThreadOption`, `hideTranslateMessageOption`,
> `hideMessageInfoOption` and the rest — and change who may edit or delete with
> `optionsPolicy: MessageOptionsPolicy(…)`.

> [tab] UIKit
>
> Every option ends at `set(onMessageOptionClick:)`, with its id:
>
> ```swift theme={null}
> messageList
>     .set(addOptions: { _ in
>         [CometChatMessageOption(id: "forward", title: "Forward",
>                                 icon: UIImage(systemName: "arrowshape.turn.up.right"))]
>     })
>     .set(onMessageOptionClick: { message, id, _ in
>         if id == "forward" { forward(message) }
>     })
> ```
>
> An option's own `onItemClick` is never called.
>
> The quick reactions sit in a capsule-shaped bar above the options. The bar is Liquid Glass on
> iOS 26; on iOS 18–25, with Reduce Transparency on, or with `renderPath` set to `.fallback`, it is
> opaque with a single continuous hairline around the capsule.

![The message option menu over a long-pressed message, with quick reactions above and options below](https://mintcdn.com/cometchat-22654f5b/pWDsskjSUHgot30F/images/ui-kit/ios/v6/docs-messageListMenu.png?fit=max\&auto=format\&n=pWDsskjSUHgot30F\&q=85\&s=034e7e1240d049d60e97c8c4975b3b35)

### More

The menu shows six options at once. With more than six, a seventh row, **More**, expands the
rest in place: the first six fold away, More stays as the header of the same card, and the other
options open under it. Tapping the header folds them back. More only navigates — it never closes
the menu and never reaches your handler — and there is no Back row.

> [tab] SwiftUI
>
> The order of your `options` or `addOptions` decides what lands under More: the first six
> show, the rest expand.
>
> Building your own menu? `MessageOptionsPaginator.split` gives you the same two groups:
>
> ```swift theme={null}
> func menuRows(for options: [MessageOption], expanded: Bool) -> [MessageOption] {
>     let (first, overflow) = MessageOptionsPaginator.split(options)
>     // `overflow` is empty with six options or fewer: draw no "More" row.
>     return expanded ? overflow : first
> }
> ```
>
> `MessageOptionsPaginator.paginate` is the paged shape — pages of six with More and Back — for a menu that pages instead.

> [tab] UIKit
>
> The order of your `set(options:)` or `set(addOptions:)` decides what lands under More: the
> first six show, the rest expand.
>
> Building your own menu? `MessageOptionsPaginator.split` gives you the same two groups, for
> any option type:
>
> ```swift theme={null}
> func menuRows(for options: [CometChatMessageOption], expanded: Bool) -> [CometChatMessageOption] {
>     let (first, overflow) = MessageOptionsPaginator.split(options)
>     // `overflow` is empty with six options or fewer: draw no "More" row.
>     return expanded ? overflow : first
> }
> ```
>
> `MessageOptionsPaginator.paginate` is the paged shape — pages of six with More and Back — for a menu that pages instead.

***

## Composer Attachment Options

Your attachment options are **appended** after the built-in ones; a tap goes to the composer's
callback.

> [tab] SwiftUI
>
> ```swift theme={null}
> CometChatMessageComposer(
>     user: user,
>     attachmentOptions: [
>         ComposerAttachmentOption(id: "location", title: "Location", icon: "location.fill")
>     ],
>     onAttachmentOptionClick: { option in
>         if option.id == "location" { shareLocation() }
>     }
> )
> ```

> [tab] UIKit
>
> ```swift theme={null}
> composer
>     .add(attachmentOption: ComposerAttachmentOption(id: "location", title: "Location", icon: "mappin.and.ellipse"))
>     .set(onAttachmentOptionClick: { option in
>         if option.id == "location" { shareLocation() }
>     })
> ```

`icon` is an SF Symbol name, or an image in your app's asset catalogue.

![The composer's attachment tray](https://mintcdn.com/cometchat-22654f5b/pWDsskjSUHgot30F/images/ui-kit/ios/v6/docs-composerTray.png?fit=max\&auto=format\&n=pWDsskjSUHgot30F\&q=85\&s=f3aba90f1471300d8492d99894c93b69)

***

## Components with Menu Options

| Component | SwiftUI closure receives | UIKit closure receives |
| - | - | - |
| `CometChatConversations` | `ChatConversation` | `Conversation`, `IndexPath` |
| `CometChatUsers` | `ChatUser` | `User?` |
| `CometChatGroups` | `ChatGroup` | `Group?` |
| `CometChatGroupMembers` | `ChatGroupMember` | `Group`, `GroupMember?` |
| `CometChatCallLogs` | `ChatCallLog` | `ChatCallLog` |
| `CometChatMessageList` | the message | `BaseMessage` |

***

## Related

* [Customization Overview](https://www.cometchat.com/docs/ui-kit/ios/v6/customization-overview.md) — every customization category.
* [Events & Callbacks](https://www.cometchat.com/docs/ui-kit/ios/v6/customization-events.md) — taps and selection.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.