ChatTopAppBar
Renders the top app bar displayed at the top of each messaging screen.
Override this to provide a custom navigation bar, add status indicators, or integrate with your app's existing toolbar. The default top app bar shows the agent name and a back-navigation action.
Parameters
content
The SDK's default top app bar. Call it to retain default rendering, or wrap it to add content above or below.
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