---
title: "animatedShape"
type: "property"
lastmod: "2026-08-27"
---
## API Reference

> Source set: Common

```kotlin
val animatedShape =
        remember(useFullScreenShape, shape) {
            when {
                shape == defaultInputFieldShape ->
                    // The shape can only be animated if it's the default spec value
                    GenericShape { size, _ ->
                        val radius =
                            with(density) {
                                (SearchBarCornerRadius * (1 - animationProgress.value)).toPx()
                            }
                        addRoundRect(RoundRect(size.toRect(), CornerRadius(radius)))
                    }

                useFullScreenShape -> defaultFullScreenShape
                else -> shape
            }
        }
```
