[android-components](../../index.md) / [mozilla.components.feature.contextmenu](../index.md) / [ContextMenuCandidate](./index.md)

# ContextMenuCandidate

`data class ContextMenuCandidate` [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/feature/contextmenu/src/main/java/mozilla/components/feature/contextmenu/ContextMenuCandidate.kt#L30)

A candidate for an item to be displayed in the context menu.

### Constructors

| Name | Summary |
|---|---|
| [&lt;init&gt;](-init-.md) | `ContextMenuCandidate(id: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, label: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, showFor: (`[`Session`](../../mozilla.components.browser.session/-session/index.md)`, `[`HitResult`](../../mozilla.components.concept.engine/-hit-result/index.md)`) -> `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`, action: (`[`Session`](../../mozilla.components.browser.session/-session/index.md)`, `[`HitResult`](../../mozilla.components.concept.engine/-hit-result/index.md)`) -> `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)`<br>A candidate for an item to be displayed in the context menu. |

### Properties

| Name | Summary |
|---|---|
| [action](action.md) | `val action: (`[`Session`](../../mozilla.components.browser.session/-session/index.md)`, `[`HitResult`](../../mozilla.components.concept.engine/-hit-result/index.md)`) -> `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>The action to be invoked once the user selects this item. |
| [id](id.md) | `val id: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>A unique ID that will be used to uniquely identify the candidate that the user selected. |
| [label](label.md) | `val label: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>The label that will be displayed in the context menu |
| [showFor](show-for.md) | `val showFor: (`[`Session`](../../mozilla.components.browser.session/-session/index.md)`, `[`HitResult`](../../mozilla.components.concept.engine/-hit-result/index.md)`) -> `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>If this lambda returns true for a given [Session](../../mozilla.components.browser.session/-session/index.md) and [HitResult](../../mozilla.components.concept.engine/-hit-result/index.md) then it will be displayed in the context menu. |

### Companion Object Functions

| Name | Summary |
|---|---|
| [createCopyImageLocationCandidate](create-copy-image-location-candidate.md) | `fun createCopyImageLocationCandidate(context: `[`Context`](https://developer.android.com/reference/android/content/Context.html)`, snackBarParentView: `[`View`](https://developer.android.com/reference/android/view/View.html)`): `[`ContextMenuCandidate`](./index.md)<br>Context Menu item: "Copy Image Location". |
| [createCopyLinkCandidate](create-copy-link-candidate.md) | `fun createCopyLinkCandidate(context: `[`Context`](https://developer.android.com/reference/android/content/Context.html)`, snackBarParentView: `[`View`](https://developer.android.com/reference/android/view/View.html)`): `[`ContextMenuCandidate`](./index.md)<br>Context Menu item: "Copy Link". |
| [createOpenImageInNewTabCandidate](create-open-image-in-new-tab-candidate.md) | `fun createOpenImageInNewTabCandidate(context: `[`Context`](https://developer.android.com/reference/android/content/Context.html)`, tabsUseCases: `[`TabsUseCases`](../../mozilla.components.feature.tabs/-tabs-use-cases/index.md)`, snackBarParentView: `[`View`](https://developer.android.com/reference/android/view/View.html)`): `[`ContextMenuCandidate`](./index.md)<br>Context Menu item: "Open Image in New Tab". |
| [createOpenInNewTabCandidate](create-open-in-new-tab-candidate.md) | `fun createOpenInNewTabCandidate(context: `[`Context`](https://developer.android.com/reference/android/content/Context.html)`, tabsUseCases: `[`TabsUseCases`](../../mozilla.components.feature.tabs/-tabs-use-cases/index.md)`, snackBarParentView: `[`View`](https://developer.android.com/reference/android/view/View.html)`): `[`ContextMenuCandidate`](./index.md)<br>Context Menu item: "Open Link in New Tab". |
| [createOpenInPrivateTabCandidate](create-open-in-private-tab-candidate.md) | `fun createOpenInPrivateTabCandidate(context: `[`Context`](https://developer.android.com/reference/android/content/Context.html)`, tabsUseCases: `[`TabsUseCases`](../../mozilla.components.feature.tabs/-tabs-use-cases/index.md)`, snackBarParentView: `[`View`](https://developer.android.com/reference/android/view/View.html)`): `[`ContextMenuCandidate`](./index.md)<br>Context Menu item: "Open Link in Private Tab". |
| [createSaveImageCandidate](create-save-image-candidate.md) | `fun createSaveImageCandidate(context: `[`Context`](https://developer.android.com/reference/android/content/Context.html)`): `[`ContextMenuCandidate`](./index.md)<br>Context Menu item: "Save image". |
| [createShareLinkCandidate](create-share-link-candidate.md) | `fun createShareLinkCandidate(context: `[`Context`](https://developer.android.com/reference/android/content/Context.html)`): `[`ContextMenuCandidate`](./index.md)<br>Context Menu item: "Share Link". |
| [defaultCandidates](default-candidates.md) | `fun defaultCandidates(context: `[`Context`](https://developer.android.com/reference/android/content/Context.html)`, tabsUseCases: `[`TabsUseCases`](../../mozilla.components.feature.tabs/-tabs-use-cases/index.md)`, snackBarParentView: `[`View`](https://developer.android.com/reference/android/view/View.html)`): `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`ContextMenuCandidate`](./index.md)`>`<br>Returns the default list of context menu candidates. |
