Icons
Iconsanimated

Edit

A pencil that strokes an underline beneath it, signalling inline editing or rename.

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
@Composable
fun EditPencil() {
    val t = rememberInfiniteTransition(label = "edit")
    val p by t.animateFloat(0f, 1f, infiniteRepeatable(tween(1400), RepeatMode.Restart), label = "p")
    val color = MaterialTheme.colorScheme.primary
    Canvas(Modifier.size(40.dp)) {
        val y = size.height * 0.78f
        drawLine(color, Offset(size.width * 0.2f, y), Offset(size.width * (0.2f + 0.6f * p), y), 2.5.dp.toPx(), StrokeCap.Round)
        translate(size.width * 0.6f * p, 0f) {
            drawPath(pencilPath(size), color)
        }
    }
}