SMINavigation
interface SMINavigation
Provides navigation state and actions for navigating between messaging screens from a replaced UI component.
Access this via LocalSMINavigation within a custom ViewComponents composable to programmatically navigate to SDK screens (chat feed, pre-chat, attachments, etc.) or to conditionally render components based on the current route.
See also
Samples
uiClient.viewComponents = object : ViewComponents {
@Composable
override fun ChatTopAppBar(content: @Composable () -> Unit) {
val navigation = LocalSMINavigation.current
val currentRoute = navigation.currentRoute?.route
if (currentRoute?.contains("ChatFeed") == true) {
Column {
Text(
text = "Custom Chat Header",
style = MaterialTheme.typography.titleLarge,
modifier = Modifier.padding(16.dp)
)
Button(onClick = { navigation.navigateToOptions() }) {
Text("Options")
}
}
} else {
content()
}
}
}Content copied to clipboard
Properties
Functions
Link copied to clipboard
Navigates back to the previous screen in the navigation stack.
Link copied to clipboard
Navigates to the attachment viewer screen.
Link copied to clipboard
Navigates to the chat feed screen.
Link copied to clipboard
Navigates to the interactive form screen.
Link copied to clipboard
Navigates to the conversation options screen.
Link copied to clipboard
Navigates to the pre-chat form screen.
Link copied to clipboard
Navigates to the transcript viewer screen.