UX4G Logo
Token

Dimensions & Spacing

Spacing scales, corner radius, and border width tokens for Android Jetpack Compose

The UX4G Dimension System provides strict mathematical scaling tokens for spacing, corner radius, and border widths to maintain consistent visual rhythm across Android applications.

All tokens are defined in com.ux4g.designsystemv1.foundation.Ux4gSpace, com.ux4g.designsystemv1.foundation.Ux4gRadius, and com.ux4g.designsystemv1.foundation.Ux4gBorderWidth.


1. Spacing Scale (Ux4gSpace)

0.dp
SpaceNoneSpacing
0.dp— Reset spacing
Ux4gSpace.SpaceNone
2.dp
Space2Spacing
2.dp— Micro inline gaps
Ux4gSpace.Space2
4.dp
Space4Spacing
4.dp— Icon gaps, badge padding
Ux4gSpace.Space4
6.dp
Space6Spacing
6.dp— Tag & chip padding
Ux4gSpace.Space6
8.dp
Space8Spacing
8.dp— Button compact padding
Ux4gSpace.Space8
12.dp
Space12Spacing
12.dp— Input internal padding
Ux4gSpace.Space12
16.dp
Space16Spacing
16.dp— Standard screen margin
Ux4gSpace.Space16
20.dp
Space20Spacing
20.dp— Card content separation
Ux4gSpace.Space20
24.dp
Space24Spacing
24.dp— Dialog & sheet gutter
Ux4gSpace.Space24
32.dp
Space32Spacing
32.dp— Header section separation
Ux4gSpace.Space32
40.dp
Space40Spacing
40.dp— Large section gap
Ux4gSpace.Space40
48.dp
Space48Spacing
48.dp— Hero section spacing
Ux4gSpace.Space48
56.dp
Space56Spacing
56.dp— Top bar offset
Ux4gSpace.Space56
64.dp
Space64Spacing
64.dp— Landing page margins
Ux4gSpace.Space64
80.dp
Space80Spacing
80.dp— Bottom dock margin
Ux4gSpace.Space80

2. Corner Radius Scale (Ux4gRadius)

0.dp
RadiusNoneRadius
0.dp— Sharp corners
Ux4gRadius.RadiusNone
2.dp
Radius2Radius
2.dp— Subtle rounded tabs
Ux4gRadius.Radius2
4.dp
Radius4Radius
4.dp— Micro badges & tags
Ux4gRadius.Radius4
8.dp
Radius8Radius
8.dp— Input fields & standard cards
Ux4gRadius.Radius8
12.dp
Radius12Radius
12.dp— Buttons & interactive cards
Ux4gRadius.Radius12
16.dp
Radius16Radius
16.dp— Modals & large feature cards
Ux4gRadius.Radius16
24.dp
Radius24Radius
24.dp— Bottom sheets & hero cards
Ux4gRadius.Radius24
999.dp
Radius999Radius
999.dp— Full circular pills & avatars
Ux4gRadius.Radius999

3. Border Width Scale (Ux4gBorderWidth)

0.dp
NoneBorder
0.dp— Borderless / Elevation-only
Ux4gBorderWidth.None
1.dp
ThinBorder
1.dp— Standard input borders & dividers
Ux4gBorderWidth.Thin
2.dp
ThickBorder
2.dp— Active focus states & high emphasis
Ux4gBorderWidth.Thick
3.dp
ThickerBorder
3.dp— Selection indicators
Ux4gBorderWidth.Thicker
4.dp
ThickestBorder
4.dp— Callout accents
Ux4gBorderWidth.Thickest

4. Kotlin Jetpack Compose Usage

Compose Usage
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import com.ux4g.designsystemv1.foundation.Ux4gBorderWidth
import com.ux4g.designsystemv1.foundation.Ux4gColors
import com.ux4g.designsystemv1.foundation.Ux4gRadius
import com.ux4g.designsystemv1.foundation.Ux4gSpace

Box(
    modifier = Modifier
        .padding(Ux4gSpace.Space16)
        .clip(RoundedCornerShape(Ux4gRadius.Radius12))
        .border(
            width = Ux4gBorderWidth.Thin,
            color = Ux4gColors.neutral300,
            shape = RoundedCornerShape(Ux4gRadius.Radius12)
        )
        .background(Ux4gColors.white)
) {
    // Card content
}

On this page