SignedOut
The SignedOut composable conditionally renders its content only when the user is not authenticated. It is the counterpart to SignedIn.
SignedOut requires ThunderIDProvider in its ancestor composable hierarchy.
Usage
import dev.thunderid.compose.components.guards.SignedOut
@Composable
fun ContentView() {
SignedOut {
Text("Please sign in to continue.")
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
fallback | (@Composable () -> Unit)? | ❌ | The composable to render when the user is authenticated. Defaults to nothing. |
content | @Composable () -> Unit | ✅ | The composable to render when the user is not authenticated. |
Example: Show a Banner for Guests
SignedOut {
Banner("Sign in to unlock all features")
}
Example: Route Between Screens
Use SignedOut alongside SignedIn to implement bidirectional routing:
SignedIn(fallback = {
SignedOut { AuthView() }
}) {
HomeView()
}