androidx.compose.material3

VerticalDragHandleSince 1.9

Composable function

One of the helpers on this page. It works like ProvideTextStyle. Only the parameters that differ are described here.

A handle the user drags to resize two panes. You move the panes yourself, for example with Modifier.draggable.

A handle between two panesExpressive theme
A handle between two panes
Row(Modifier.size(320.dp, 140.dp), verticalAlignment = Alignment.CenterVertically) {
    Surface(Modifier.weight(1f).fillMaxHeight(), color = MaterialTheme.colorScheme.surfaceContainer, shape = MaterialTheme.shapes.large) {}
    VerticalDragHandle(Modifier.padding(horizontal = 8.dp))
    Surface(Modifier.weight(1f).fillMaxHeight(), color = MaterialTheme.colorScheme.surfaceContainer, shape = MaterialTheme.shapes.large) {}
}

Parameters

@Composable
fun VerticalDragHandle(
    modifier: Modifier = Modifier,
    sizes: DragHandleSizes = VerticalDragHandleDefaults.sizes(),
    colors: DragHandleColors = VerticalDragHandleDefaults.colors(),
    shapes: DragHandleShapes = VerticalDragHandleDefaults.shapes(),
    interactionSource: MutableInteractionSource? = null,
)

modifier: ModifierOptional

Default: Modifier

Changes size, padding, or position. See the Modifier guide.

sizes: DragHandleSizesOptional

Default: VerticalDragHandleDefaults.sizes()

The size of the drag handle, at rest and pressed.

colors: DragHandleColorsOptional

Default: VerticalDragHandleDefaults.colors()

The colors of the drag handle or scroll field.

shapes: DragHandleShapesOptional

Default: VerticalDragHandleDefaults.shapes()

The shape of the drag handle, at rest and pressed.

interactionSource: MutableInteractionSource?Optional

Default: null

Lets you observe or control press, hover and focus states. Leave it null unless your code must react to them. See InteractionSource.

Helpers on this page