API reference

SpatialChoiceListDialog Function

Displays a spatial dialog with a choice list, title, description, and action buttons.

Signature

fun SpatialChoiceListDialog(
    title: String,
    description: String,
    listHeaderText: String,
    selectedItem: SpatialChoiceListDialogItem? = null,
    items: List<SpatialChoiceListDialogItem>,
    onItemSelected: (SpatialChoiceListDialogItem) -> Unit,
    primaryChoiceActionLabel: String,
    onPrimaryChoiceActionClick: () -> Unit,
    secondaryChoiceActionLabel: String? = null,
    onSecondaryChoiceActionClick: () -> Unit? = null,
    tertiaryChoiceActionLabel: String? = null,
    onTertiaryChoiceActionClick: () -> Unit? = null,
    leading: () -> Unit? = null,
    trailing: () -> Unit? = null,
)

Parameters

title: String The title of the dialog.
description: String The description of the dialog.
listHeaderText: String The header text for the choice list.
selectedItem: SpatialChoiceListDialogItem? The currently selected item in the choice list (optional).
items: List<SpatialChoiceListDialogItem> The list of items to display in the choice list.
onItemSelected: (SpatialChoiceListDialogItem) -> Unit The callback to invoke when an item is selected.
primaryChoiceActionLabel: String The label for the primary action button.
onPrimaryChoiceActionClick: () -> Unit The callback to invoke when the primary action button is clicked.
secondaryChoiceActionLabel: String? The label for the secondary action button (optional).
onSecondaryChoiceActionClick: (() -> Unit)? The callback to invoke when the secondary action button is clicked (optional).
tertiaryChoiceActionLabel: String? The label for the tertiary action button (optional).
onTertiaryChoiceActionClick: (() -> Unit)? The callback to invoke when the tertiary action button is clicked (optional).
leading: (() -> Unit)? An optional composable to display as leading content.
trailing: (() -> Unit)? An optional composable to display as trailing content.