Skip to content

Navigation

For sub-menus, cascade will automatically navigate back when their title is clicked. For manual navigation, CascadeState#navigateBack() can be used.

val state = rememberCascadeState()
CascadeDropdownMenu(
  state = state, 
  
) {
  DropdownMenuItem(
    text = { Text("Remove") },
    childrenHeader = {
      // childrenHeader is an optional parameter. If you don't provide one, cascade
      // will automatically use the text composable ("Remove" in this example).
      DropdownMenuHeader { Text("Are you sure?") }
    },
    children = {
      DropdownMenuItem(
        text = { Text("Burn them all") },
        onClick = {  }
      )
      DropdownMenuItem(
        text = { Text("Take me back") },
        onClick = { state.navigateBack() }
      )
    },
  )
}