Inputs
Inputsanimated

Gradient border

Field framed by a slowly shifting gradient border for a premium, focused feel.

Installation

caveui components are copy-paste Jetpack Compose built entirely on Material 3 — there's no caveui dependency to add. Make sure Material 3 is on your classpath (it ships with the Compose BOM), then copy the Usage snippet below into your project.

kotlin
// build.gradle.kts (module)
dependencies {
    implementation(platform("androidx.compose:compose-bom:2025.06.00"))
    implementation("androidx.compose.material3:material3")
}

Usage

kotlin
val transition = rememberInfiniteTransition(label = "grad")
val shift by transition.animateFloat(
    initialValue = 0f, targetValue = 1f,
    animationSpec = infiniteRepeatable(tween(4000)),
    label = "shift",
)
val brush = Brush.linearGradient(
    colors = listOf(
        Color(0xFFF59E0B), Color(0xFFEC4899), Color(0xFF6366F1),
    ),
    start = Offset(shift * 300f, 0f),
    end = Offset(shift * 300f + 300f, 0f),
)
OutlinedTextField(
    value = value,
    onValueChange = { value = it },
    placeholder = { Text("Premium field") },
    modifier = Modifier.border(2.dp, brush, MaterialTheme.shapes.medium),
    colors = OutlinedTextFieldDefaults.colors(
        focusedBorderColor = Color.Transparent,
        unfocusedBorderColor = Color.Transparent,
    ),
)