# DockedEdge

Artifact: [androidx.compose.material3.adaptive:adaptive-layout](https://developer.android.com/jetpack/androidx/releases/compose-material3-adaptive) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/adaptive/layout/DragToResizeState.kt+class:androidx.compose.material3.adaptive.layout.DockedEdge) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/compose-material3-adaptive#1.3.0) Common/All
- Cmn

  ```
  @ExperimentalMaterial3AdaptiveApi
  enum DockedEdge : Enum<DockedEdge>
  ```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [kotlin.Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)\<[DockedEdge](https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/DockedEdge)\> ||
|   | ↳ | [androidx.compose.material3.adaptive.layout.DockedEdge](https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/DockedEdge) |

*** ** * ** ***

Represents the edge of a resizable pane that is docked, i.e. the edge that will stay in the same position during resizing.

For example if the edge is `https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/DockedEdge#Top`, the top edge of the pane won't move and the bottom edge will be moveable to resize the pane.

Note that `https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/DragToResizeState` only supports resizing along one orientation according to their `https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/DockedEdge`. For example if `https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/DockedEdge#Top` or `https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/DockedEdge#Bottom` has been set, the resizing can only happen along the vertical axis.

```kotlin
import androidx.compose.foundation.background
import androidx.compose.material3.BottomSheetDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.adaptive.layout.AnimatedPane
import androidx.compose.material3.adaptive.layout.PaneExpansionAnchor
import androidx.compose.material3.adaptive.layout.PaneExpansionState
import androidx.compose.material3.adaptive.layout.SupportingPaneScaffold
import androidx.compose.material3.adaptive.layout.rememberPaneExpansionState
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp

val coroutineScope = rememberCoroutineScope()
val scaffoldNavigator = levitateAsBottomSheetSample<NavItemData>()
val extraItems = listOf("Extra content")
val selectedItem = NavItemData(index = 0, showExtra = true)

SupportingPaneScaffold(
    directive = scaffoldNavigator.scaffoldDirective,
    scaffoldState = scaffoldNavigator.scaffoldState,
    mainPane = {
        AnimatedPane {
            MainPaneContent(
                scaffoldNavigator = scaffoldNavigator,
                hasExtraPane = true,
                coroutineScope = coroutineScope,
            )
        }
    },
    supportingPane = {
        AnimatedPane(modifier = Modifier.preferredWidth(200.dp)) { SupportingPaneContent() }
    },
    extraPane = {
        AnimatedPane(
            modifier =
                Modifier.preferredWidth(1f)
                    .preferredHeight(0.5f)
                    .background(MaterialTheme.colorScheme.surface),
            dragToResizeHandle = { BottomSheetDefaults.DragHandle() },
        ) {
            ExtraPaneContent(
                extraItems = extraItems,
                selectedItem = selectedItem,
                scaffoldNavigator = scaffoldNavigator,
                coroutineScope = coroutineScope,
            )
        }
    },
    paneExpansionState =
        rememberPaneExpansionState(
            keyProvider = scaffoldNavigator.scaffoldValue,
            anchors = PaneExpansionAnchors,
        ),
    paneExpansionDragHandle = { state -> PaneExpansionDragHandleSample(state) },
)
```

## Summary

| ### Enum Values |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/DockedEdge#Bottom` | The bottom edge of the pane is fixed, and resizing happens by moving the top edge. |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/DockedEdge#End` | The end edge of the pane is fixed, and resizing happens by moving the start edge. |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/DockedEdge#Start` | The start edge of the pane is fixed, and resizing happens by moving the end edge. |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/DockedEdge#Top` | The top edge of the pane is fixed, and resizing happens by moving the bottom edge. |

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/DockedEdge` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/DockedEdge#valueOf(kotlin.String)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Returns the enum constant of this type with the specified name. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/DockedEdge>` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/DockedEdge#values()()` Returns an array containing the constants of this enum type, in the order they're declared. | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html<https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/DockedEdge>` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/adaptive/layout/DockedEdge#entries()` Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared. | Cmn |

## Enum Values

### Bottom

```
@ExperimentalMaterial3AdaptiveApi
val DockedEdge.Bottom: DockedEdge
```

The bottom edge of the pane is fixed, and resizing happens by moving the top edge.

### End

```
@ExperimentalMaterial3AdaptiveApi
val DockedEdge.End: DockedEdge
```

The end edge of the pane is fixed, and resizing happens by moving the start edge.

### Start

```
@ExperimentalMaterial3AdaptiveApi
val DockedEdge.Start: DockedEdge
```

The start edge of the pane is fixed, and resizing happens by moving the end edge.

### Top

```
@ExperimentalMaterial3AdaptiveApi
val DockedEdge.Top: DockedEdge
```

The top edge of the pane is fixed, and resizing happens by moving the bottom edge.

## Public functions

### valueOf

Cmn Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/compose-material3-adaptive#1.3.0)

```
fun valueOf(value: String): DockedEdge
```

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if this enum type has no constant with the specified name |

### values

Cmn Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/compose-material3-adaptive#1.3.0)

```
fun values(): Array<DockedEdge>
```

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.

The function returns a new instance of the array on every call. The array could be mutated, so working with it may also require defensive copying. Consider using `entries` property as a more efficient alternative returning an immutable list of enum entries.

## Public properties

### entries

Cmn

```
val entries: EnumEntries<DockedEdge>
```

Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared.