UX4G Logo
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), and Text (minimal plain text).
  • Shapes & Sizes: Circular (pill shape, 999dp radius) and Rectangular (rounded rectangular, 4dp radius); M (20dp height) and L (24dp height).
  • Unified Multi-Segment Pill Tag: Ux4gUnifiedPillTag combining multiple Ux4gPillSegment entries 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 onDismiss close 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
UX4G Default Tags Preview

2. Unified Pill Tag (Ux4gUnifiedPillTag)

Multi-segment unified pill badge combining timeline metadata and status states separated by an integrated vertical divider.

Ux4gUnifiedPillTagJetpack Compose
UX4G Unified Pill Tag Preview

Kotlin Usage

1. Document Classification & Verification Status

DocumentStatusTags.kt
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

ApplicationTrackingTag.kt
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

PropTypeDescriptionDefault
text *StringLabel text displayed inside the tag container.—
modifierModifierCompose modifier applied to the outer tag container.Modifier
sizeUx4gTagSizeTag height and padding size (M = 20dp, L = 24dp).Ux4gTagSize.M
shapeUx4gTagShapeTag corner geometry (Circular = 999dp pill, Rectangular = 4dp).Ux4gTagShape.Circular
styleUx4gTagStyleFill style variant (Tonal, Filled, Outline, Text).Ux4gTagStyle.Tonal
colorSchemeUx4gTagColorPredefined 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
customBackgroundColorColor?Custom background color override.null
customContentColorColor?Custom text and icon tint color override.null
customBorderColorColor?Custom border stroke color override.null
customBorderWidthDp?Custom border stroke width override.null
customTextStyleTextStyle?Custom typography style override.null
customCornerRadiusDp?Custom corner radius value override.null

Ux4gUnifiedPillTag Props

PropTypeDescriptionDefault
segments *List<Ux4gPillSegment>List of text/icon segments displayed sequentially with integrated dividers.—
modifierModifierCompose modifier applied to the unified pill container.Modifier
sizeUx4gTagSizeHeight and padding scale (M = 20dp, L = 24dp).Ux4gTagSize.L
backgroundColorColor?Background fill color for the unified container.null
borderColorColor?Outer border stroke color.null
borderWidthDpOuter border stroke width.1.dp
dividerColorColor?Color of vertical dividers placed between segments.null
customBorderRadiusDpContainer corner radius.Ux4gRadius.Radius8

Ux4gPillSegment Data Model

FieldTypeDescriptionDefault
text *StringSegment text label.—
leading(@Composable () -> Unit)?Optional composable rendered before the segment text (e.g. status dot).null
textColorColor?Custom text color for this individual segment.null
boldBooleanWhether to apply bold/strong font weight styling.false

Ux4gTagColor Reference

Color SchemeBackground (Tonal)Background (Filled)Content / Text (Tonal)Content (Filled)
NeutralonSurface (10% alpha)onSurface (50% alpha)onSurface (80% alpha)Ux4gColors.white
Brandprimary (12% alpha)primaryprimaryUx4gColors.white
Successgreen600 (12% alpha)green600green600Ux4gColors.white
Warningorange600 (12% alpha)orange600orange600Ux4gColors.white
Errorred600 (12% alpha)red600red600Ux4gColors.white
Infocyan600 (12% alpha)cyan600cyan600Ux4gColors.white

Ux4gTagStyle Reference

StyleBackgroundBorderContent ColorTypical Context
TonalTheme Tint (12% alpha)NoneFull Tone ColorCategory badges, metadata chips, status summaries
FilledSolid Theme ColorNoneWhite / SurfaceHigh-contrast critical alerts, urgent flags
OutlineTransparentTheme Color (1dp)Theme ColorSecondary filters, selectable tags, status tags
TextTransparentNoneTheme ColorLightweight inline tags in dense tables or list rows

On this page