Components
Empty State
Informative fallback view for zero search results, empty inboxes, offline errors, and upcoming features
The UX4G Empty State suite provides clean and informative fallback screens when data is absent, search filters return zero items, or network errors occur:
- Semantic Presets (
Ux4gEmptyStateVariant): Automatic icon selection and typography forNoResults,NoData,ComingSoon, andError. - Actionable Call-to-Action: Integrated tonal button (e.g.
"Clear all filters","Refresh Inbox","Try Again"). - Custom Content Slot: Support for custom illustrations, vector drawables, and additional action buttons.
Import from com.ux4g.designsystemv1.components.Ux4gEmptyState.
Interactive Preview
Ux4gEmptyState - Semantic Presets & ActionsJetpack Compose

Kotlin Usage
import androidx.compose.foundation.layout.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.ux4g.designsystemv1.components.Ux4gEmptyState
import com.ux4g.designsystemv1.components.Ux4gEmptyStateVariant
import com.ux4g.designsystemv1.components.buttons.Ux4gButtonSize
@Composable
fun EmptyStateShowcaseScreen() {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
verticalArrangement = Arrangement.spacedBy(24.dp)
) {
// Search Zero State
Ux4gEmptyState(
variant = Ux4gEmptyStateVariant.NoResults,
title = "No applications found",
subtitle = "Try adjusting your search criteria or explore popular citizen services.",
buttonText = "Explore All Services",
buttonSize = Ux4gButtonSize.Medium,
onButtonPressed = { /* navigate to directory */ }
)
// Empty Inbox
Ux4gEmptyState(
variant = Ux4gEmptyStateVariant.NoData,
title = "All Caught Up!",
subtitle = "You have no unread notifications or pending actions.",
buttonText = "Check Again",
onButtonPressed = { /* refresh */ }
)
}
}Parameters
Ux4gEmptyState Props
| Prop | Type | Description | Default |
|---|---|---|---|
title * | String | Bold primary headline message displayed below icon. | — |
modifier | Modifier | Compose layout modifier applied to outer column. | Modifier |
variant | Ux4gEmptyStateVariant | Semantic preset controlling default icon selection. | Ux4gEmptyStateVariant.Custom |
icon | Any? | Custom icon override (ImageVector, Ux4gIcon, or drawable resource ID). | null (uses variant default) |
iconContent | (@Composable () -> Unit)? | Custom composable slot replacing the default icon. | null |
iconSize | Dp | Size dimensions (width & height) of the hero icon. | 48.dp |
iconColor | Color? | Custom tint color for hero icon (null uses Ux4gColors.primary). | null |
subtitle | String? | Secondary subtitle text line. | null |
description | String? | Tertiary explanatory description line. | null |
titleStyle | TextStyle? | Custom typography style override for title. | null (hXXS_strong) |
bodyStyle | TextStyle? | Custom typography style override for subtitle/description. | null (bS_default) |
buttonText | String? | Label text for the filled tonal call-to-action button. | null |
onButtonPressed | (() -> Unit)? | Callback invoked when citizen taps the action button. | null |
buttonSize | Ux4gButtonSize | Size dimensions of the action button: Small, Medium, Large. | Ux4gButtonSize.Small |
buttonLeadingIcon | Any? | Optional leading icon rendered inside the action button. | null |
padding | PaddingValues | Outer padding surrounding the entire empty state container. | PaddingValues(24.dp) |
bodyHorizontalPadding | Dp | Horizontal padding applied to body text for optimal reading width. | 24.dp |
customContent | (@Composable () -> Unit)? | Optional composable slot below body text. | null |
Ux4gEmptyStateVariant Enum
| Variant | Default Icon | Semantic Use Case |
|---|---|---|
NoResults | Icons.Default.SearchOff | Search or filter criteria returned 0 items. |
NoData | Icons.Default.Inbox | List or inbox is currently empty. |
ComingSoon | Icons.Default.RocketLaunch | New service or feature under development. |
Error | Icons.Default.ErrorOutline | Network failure or server request error. |
Custom | Icons.Default.Info | Fully customized empty state. |
Dropdown
Interactive Action Dropdown menus and Selection Dropdown fields supporting Single select, Multi-select with chips, and search filtering
Feedback Form
Comprehensive citizen feedback suite featuring 5-Star Ratings with improvement tags, CSAT sentiment face scales, and NPS (0-10) recommendation forms