Components
Tag
Compact metadata pills and unified multi-segment status badges for categories, government schemes, and verification states
The UX4G Tag component renders compact metadata pills and status indicators. It helps citizens and administrators quickly identify document classifications, application states, priority flags, and multi-part status summaries across government portals.
Key Capabilities
- Semantic Color Schemes: 6 purpose-built color themes (
Neutral,Brand,Success,Warning,Error,Info). - Visual Styles:
Tonal(tinted background),Filled(solid high-contrast background),Outline(bordered), andText(minimal plain text). - Shapes & Sizes:
Circular(pill shape, 999dp radius) andRectangular(rounded rectangular, 4dp radius);M(20dp height) andL(24dp height). - Unified Multi-Segment Pill Tag:
Ux4gUnifiedPillTagcombining multipleUx4gPillSegmententries separated by clean vertical dividers inside a single cohesive container (e.g.,"2 days remaining | Pending"). - Leading Content & Dismiss Slot: Support for leading icons, avatar initials, or status dots, plus optional
onDismissclose action button. - Custom Styling: Complete custom overrides for background color, content color, border stroke, typography, and corner radius.
Import from com.ux4g.designsystemv1.components.tag.*.
Interactive Previews
1. Default Tags (Ux4gTag)
Single-value status and category pills rendered across semantic color themes (Neutral, Brand, Success, Warning, Error, Info) with leading icon slots.
Ux4gTagJetpack Compose

2. Unified Pill Tag (Ux4gUnifiedPillTag)
Multi-segment unified pill badge combining timeline metadata and status states separated by an integrated vertical divider.
Ux4gUnifiedPillTagJetpack Compose

Kotlin Usage
1. Document Classification & Verification Status
import androidx.compose.foundation.layout.*
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.ux4g.designsystemv1.components.tag.*
import com.ux4g.designsystemv1.foundation.Ux4gColors
import com.ux4g.designsystemv1.foundation.Ux4gIconComponent
import com.ux4g.designsystemv1.foundation.Ux4gIcons
@Composable
fun DocumentStatusTagExample() {
var isDismissed by remember { mutableStateOf(false) }
Row(
horizontalArrangement = Arrangement.spacedBy(8.dp),
modifier = Modifier.padding(16.dp)
) {
// Tonal Scheme Pill Tag with Leading Icon
Ux4gTag(
text = "Central Sector Scheme",
colorScheme = Ux4gTagColor.Brand,
style = Ux4gTagStyle.Tonal,
size = Ux4gTagSize.M,
leadingContent = {
Ux4gIconComponent(
icon = Ux4gIcons.Home,
contentDescription = "Scheme",
modifier = Modifier.size(12.dp),
tint = Ux4gColors.primary
)
}
)
// Rectangular Outline Status Tag
Ux4gTag(
text = "Verified",
colorScheme = Ux4gTagColor.Success,
shape = Ux4gTagShape.Rectangular,
style = Ux4gTagStyle.Outline,
size = Ux4gTagSize.M
)
// Dismissible Filter Tag
if (!isDismissed) {
Ux4gTag(
text = "State: Maharashtra",
colorScheme = Ux4gTagColor.Neutral,
style = Ux4gTagStyle.Tonal,
size = Ux4gTagSize.M,
onDismiss = { isDismissed = true }
)
}
}
}2. Unified Multi-Segment Tracking Pill
import androidx.compose.foundation.layout.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.ux4g.designsystemv1.components.tag.*
@Composable
fun ApplicationTrackingBadge() {
Ux4gUnifiedPillTag(
segments = listOf(
Ux4gPillSegment(
text = "2 days remaining",
bold = false
),
Ux4gPillSegment(
text = "Pending",
textColor = Color(0xFFFA8C16), // Warning Orange
bold = true
)
),
size = Ux4gTagSize.L,
backgroundColor = Color(0xFFFFFFFF),
borderColor = Color(0xFFE5E7EB),
dividerColor = Color(0xFFE5E7EB)
)
}Parameters
Ux4gTag Props
| Prop | Type | Description | Default |
|---|---|---|---|
text * | String | Label text displayed inside the tag container. | — |
modifier | Modifier | Compose modifier applied to the outer tag container. | Modifier |
size | Ux4gTagSize | Tag height and padding size (M = 20dp, L = 24dp). | Ux4gTagSize.M |
shape | Ux4gTagShape | Tag corner geometry (Circular = 999dp pill, Rectangular = 4dp). | Ux4gTagShape.Circular |
style | Ux4gTagStyle | Fill style variant (Tonal, Filled, Outline, Text). | Ux4gTagStyle.Tonal |
colorScheme | Ux4gTagColor | Predefined semantic color theme (Neutral, Brand, Success, Warning, Error, Info). | Ux4gTagColor.Neutral |
leadingContent | (@Composable () -> Unit)? | Optional leading composable slot for icons, avatars, or status indicators. | null |
onDismiss | (() -> Unit)? | Optional callback rendering a trailing close icon button for removable tags. | null |
customBackgroundColor | Color? | Custom background color override. | null |
customContentColor | Color? | Custom text and icon tint color override. | null |
customBorderColor | Color? | Custom border stroke color override. | null |
customBorderWidth | Dp? | Custom border stroke width override. | null |
customTextStyle | TextStyle? | Custom typography style override. | null |
customCornerRadius | Dp? | Custom corner radius value override. | null |
Ux4gUnifiedPillTag Props
| Prop | Type | Description | Default |
|---|---|---|---|
segments * | List<Ux4gPillSegment> | List of text/icon segments displayed sequentially with integrated dividers. | — |
modifier | Modifier | Compose modifier applied to the unified pill container. | Modifier |
size | Ux4gTagSize | Height and padding scale (M = 20dp, L = 24dp). | Ux4gTagSize.L |
backgroundColor | Color? | Background fill color for the unified container. | null |
borderColor | Color? | Outer border stroke color. | null |
borderWidth | Dp | Outer border stroke width. | 1.dp |
dividerColor | Color? | Color of vertical dividers placed between segments. | null |
customBorderRadius | Dp | Container corner radius. | Ux4gRadius.Radius8 |
Ux4gPillSegment Data Model
| Field | Type | Description | Default |
|---|---|---|---|
text * | String | Segment text label. | — |
leading | (@Composable () -> Unit)? | Optional composable rendered before the segment text (e.g. status dot). | null |
textColor | Color? | Custom text color for this individual segment. | null |
bold | Boolean | Whether to apply bold/strong font weight styling. | false |
Ux4gTagColor Reference
| Color Scheme | Background (Tonal) | Background (Filled) | Content / Text (Tonal) | Content (Filled) |
|---|---|---|---|---|
Neutral | onSurface (10% alpha) | onSurface (50% alpha) | onSurface (80% alpha) | Ux4gColors.white |
Brand | primary (12% alpha) | primary | primary | Ux4gColors.white |
Success | green600 (12% alpha) | green600 | green600 | Ux4gColors.white |
Warning | orange600 (12% alpha) | orange600 | orange600 | Ux4gColors.white |
Error | red600 (12% alpha) | red600 | red600 | Ux4gColors.white |
Info | cyan600 (12% alpha) | cyan600 | cyan600 | Ux4gColors.white |
Ux4gTagStyle Reference
| Style | Background | Border | Content Color | Typical Context |
|---|---|---|---|---|
Tonal | Theme Tint (12% alpha) | None | Full Tone Color | Category badges, metadata chips, status summaries |
Filled | Solid Theme Color | None | White / Surface | High-contrast critical alerts, urgent flags |
Outline | Transparent | Theme Color (1dp) | Theme Color | Secondary filters, selectable tags, status tags |
Text | Transparent | None | Theme Color | Lightweight inline tags in dense tables or list rows |