# NavEntry

Artifact: [androidx.navigation3:navigation3-runtime](https://developer.android.com/jetpack/androidx/releases/navigation3) [View Source](https://cs.android.com/search?q=file:androidx/navigation3/runtime/NavEntry.kt+class:androidx.navigation3.runtime.NavEntry) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/navigation3#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  class NavEntry<T : Any>
  ```

*** ** * ** ***

Entry maintains and stores the key and the content represented by that key. Entries should be created as part of a reference/androidx/navigation/NavDisplay.

| Parameters |
|---|---|
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` | the type of the key for this NavEntry |

## Summary

| ### Public constructors |
|---|---|
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/NavEntry#NavEntry(androidx.navigation3.runtime.NavEntry,kotlin.Function1)(navEntry: https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/NavEntry<T>, content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable (T) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` NavEntry constructor to create a NavEntry from another NavEntry | Cmn |
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/NavEntry#NavEntry(kotlin.Any,kotlin.Any,kotlin.collections.Map,kotlin.Function1)( key: T, contentKey: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, metadata: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>, content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable (T) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html )` | Cmn |

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/NavEntry#Content()()` Invokes the composable content of this NavEntry with the key that was provided when instantiating this NavEntry | Cmn |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/NavEntry#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/NavEntry#hashCode()()` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/NavEntry#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html` | `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/NavEntry#contentKey()` A unique, stable id that 1. uniquely identifies the content of this NavEntry 2. uniquely identifies any `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/NavEntryDecorator` states associated with this NavEntry. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` | `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/NavEntry#metadata()` provides information to the display | Cmn |

## Public constructors

### NavEntry

Cmn

```
<T : Any> NavEntry(navEntry: NavEntry<T>, content: @Composable (T) -> Unit)
```

NavEntry constructor to create a NavEntry from another NavEntry

| Parameters |
|---|---|
| `navEntry: https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/NavEntry<T>` | The entry that provides the `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/NavEntry#key()`, `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/NavEntry#contentKey()`, and `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/NavEntry#metadata()` for the new entry. |
| `content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable (T) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | content for this entry to be displayed when this entry is active |

### NavEntry

Cmn

```
<T : Any> NavEntry(
    key: T,
    contentKey: Any = defaultContentKey(key),
    metadata: Map<String, Any> = emptyMap(),
    content: @Composable (T) -> Unit
)
```

| Parameters |
|---|---|
| `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` | the type of the key for this NavEntry |
| `key: T` | key for this entry |
| `contentKey: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html = defaultContentKey(key)` | A unique, stable id that 1. uniquely identifies the content of this NavEntry 2. uniquely identifies any `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/NavEntryDecorator` states associated with this NavEntry. ```kotlin NavEntries that share the same contentKey will be handled as sharing the same content and/or [NavEntryDecorator] state. To maximize stability, it should be derived from the [key]. The contentKey type must be saveable (i.e. on Android, it should be saveable via Android). Defaults to [key].toString(). **IMPORTANT for JS platform** Make sure to override the default contentKey for hierarchical keys. ContentKey defaults to a [Pair] of `key.toString()` and `key::class`. On JS, `key::class` returns the simple class name because fully qualified names are not supported. This means that certain hierarchical keys, such as same class names with different parent interfaces will share the same default contentKey - `A.Home` & `B.Home` will both have `Pair("Home", "class Home") as contentKey. ``` |
| `metadata: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> = emptyMap()` | provides information to the display |
| `content: @https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable (T) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | content for this entry to be displayed when this entry is active |

## Public functions

### Content

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/navigation3#1.0.0)

```
@Composable
fun Content(): Unit
```

Invokes the composable content of this NavEntry with the key that was provided when instantiating this NavEntry

### equals

Cmn

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

Cmn

```
open fun hashCode(): Int
```

### toString

Cmn

```
open fun toString(): String
```

## Public properties

### contentKey

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/navigation3#1.0.0)

```
val contentKey: Any
```

A unique, stable id that 1. uniquely identifies the content of this NavEntry 2. uniquely identifies any `https://developer.android.com/reference/kotlin/androidx/navigation3/runtime/NavEntryDecorator` states associated with this NavEntry.

```kotlin
NavEntries that share the same contentKey will be handled as sharing the same content and/or
[NavEntryDecorator] state. To maximize stability, it should be derived from the [key]. The
contentKey type must be saveable (i.e. on Android, it should be saveable via Android).
Defaults to [key].toString().

**IMPORTANT for JS platform** Make sure to override the default contentKey for hierarchical
keys. ContentKey defaults to a [Pair] of `key.toString()` and `key::class`. On JS,
`key::class` returns the simple class name because fully qualified names are not supported.
This means that certain hierarchical keys, such as same class names with different parent
interfaces will share the same default contentKey - `A.Home` & `B.Home` will both have
`Pair("Home", "class Home") as contentKey.
```

### metadata

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/navigation3#1.0.0)

```
val metadata: Map<String, Any>
```

provides information to the display