API reference

ChoiceListDialog Composable

Displays a modal dialog for selecting one item before confirming an action.

Signature

@Composable
fun ChoiceListDialog(
    title: String,
    description: String,
    listHeader: String,
    items: PersistentList<ChoiceListDialogItem>,
    selectedItem: ChoiceListDialogItem?,
    onItemSelected: (ChoiceListDialogItem) -> Unit,
    primaryAction: DialogAction,
    onDismissRequest: () -> Unit,
    modifier: Modifier = Modifier,
    secondaryAction: DialogAction? = null,
    tertiaryAction: DialogAction? = null,
    leading: @Composable () -> Unit? = null,
    trailing: @Composable () -> Unit? = null,
    colors: DialogColors = DialogDefaults.Colors,
    dimensions: DialogDimensions = UiSetTheme.dimensions.dialogs,
    shape: Shape = UiSetTheme.shapes.dialog,
    properties: DialogProperties = DialogProperties(usePlatformDefaultWidth = false),
)

Parameters

title: String dialog heading
description: String explanatory body text
listHeader: String heading above the choices
items: PersistentList immutable snapshot of available choices
selectedItem: ChoiceListDialogItem? currently selected choice, or null when none is selected
onItemSelected: (ChoiceListDialogItem) -> Unit callback receiving the selected choice
primaryAction: DialogAction highest-emphasis action, usually confirming the selection
onDismissRequest: () -> Unit callback for outside-click, back, or system dismissal
modifier: Modifier modifier applied to the dialog container
secondaryAction: DialogAction? optional supporting action beside the primary action
tertiaryAction: DialogAction? optional low-emphasis action below the main action row
leading: (@Composable () -> Unit)? optional control at the start of the title row
trailing: (@Composable () -> Unit)? optional control at the end of the title row
colors: DialogColors semantic dialog and choice colors
dimensions: DialogDimensions dialog width, spacing, action, and choice geometry
shape: Shape dialog container shape
properties: DialogProperties platform dialog behavior