Skip to content

Modifiers and utilities ​

See Primitives for components or Core for operating-system information.

Conditional modifiers ​

Use Modifier.thenIf to append a modifier when a condition is true. Preserve the order that determines layout, clipping, background, and the hit area.

kotlin
Modifier
    .fillMaxWidth()
    .thenIf(showBackground) {
        background(SaltTheme.colors.subBackground)
    }

Modifier.onPointerEventCompat adapts pointer events across platforms. Prefer built-in controls when you need touch, pointer, and keyboard support.

Padding ​

Modifier.innerPadding() uses the theme's content spacing. Item components already include their own layout. In a BasicScreen, use the supplied content padding.

Window insets ​

Use WindowInsets.safeMain, safeMainIgnoringVisibility, or safeMainCompat when building a custom layout that needs its own inset handling. Use container-provided padding when available.

Interaction and color ​

APIUse
AlphaIndicationAn optional opacity-based indication. The theme defaults to ripple.
Clickable extensionsInteraction helpers that work with SaltUI feedback.
EdgeAn edge direction, for example in overscroll configuration.
SaltPalettePreset colors. For app UI prefer semantic roles in SaltTheme.colors.
UnstableSaltUiApiMarks unstable UI APIs.

See the UI module source for declarations and platform availability.

Google/Android 是 Google LLC 的注册商标,Salt Player 和糖醋音乐均是寻浔科技(上海)有限公司在中华人民共和国的注册商标