<h2 id="rememberdragtoresizestate-dockededge-minsize-maxsize">rememberDragToResizeState</h2>

<div class='sourceset sourceset-common'>Common</div>

```kotlin
@ExperimentalMaterial3AdaptiveApi
@Composable
fun rememberDragToResizeState(
    dockedEdge: DockedEdge,
    minSize: Dp = Dp.Unspecified,
    maxSize: Dp = Dp.Unspecified,
): DragToResizeState
```

Creates and remembers a [DragToResizeState](/jetpack-compose/androidx.compose.material3.adaptive/adaptive-layout/classes/DragToResizeState) instance.

This function creates a state object that tracks and controls the resizing behavior of a
composable element via dragging. The state is saved and restored across recompositions and
configuration changes using [rememberSaveable](/jetpack-compose/androidx.compose.runtime/runtime-saveable/composable-functions/rememberSaveable).

To support the drag-to-resize behavior, provide [DragToResizeState](/jetpack-compose/androidx.compose.material3.adaptive/adaptive-layout/classes/DragToResizeState) objects when creating
[AdaptStrategy.Levitate](/jetpack-compose/androidx.compose.material3.adaptive/adaptive-layout/classes/AdaptStrategy.Levitate) instances and provide a drag handle to the [AnimatedPane](/jetpack-compose/androidx.compose.material3.adaptive/adaptive-layout/composable-functions/AnimatedPane) composable,
which will show the drag handle and associate it with the state object when it's levitated, so
the pane will act like a modal sheet, and users can drag or click the drag handle to resize the
pane.

Note that with the default implementation, clicking the drag handle will make the associated pane
go through three states: collapsed, partially expanded, and expanded. When in the expanded state,
the pane will be displayed in its maximum possible size, bounded by the scaffold's size and the
maximum size set via [rememberDragToResizeState](/jetpack-compose/androidx.compose.material3.adaptive/adaptive-layout/composable-functions/rememberDragToResizeState). When in the collapsed state, the associated
pane will be displayed in its minimum size set via [rememberDragToResizeState](/jetpack-compose/androidx.compose.material3.adaptive/adaptive-layout/composable-functions/rememberDragToResizeState). And in the
partially expanded size, the pane will be displayed in its default size or the size set by user
with dragging.

#### Parameters

| | |
| --- | --- |
| dockedEdge | The edge to which the element is docked. This determines the orientation of the resizing operation (horizontal or vertical) and the direction of the size change when dragging. |
| minSize | The minimum allowed size for the resizable element, as a `Dp`. Defaults to `Dp.Unspecified`, which instructs scaffold to use its default setting. |
| maxSize | The maximum allowed size for the resizable element, as a `Dp`. Defaults to `Dp.Unspecified`. Note that the dragged size cannot be larger than the scaffold's size, even if the max size set here is larger than the scaffold's size. |