# CornerBasedShape

Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/shape/CornerBasedShape.kt+class:androidx.compose.foundation.shape.CornerBasedShape) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0) Common/All
- Cmn

  ```
  abstract class CornerBasedShape : Shape, Interpolatable
  ```
Known direct subclasses [AbsoluteCutCornerShape](https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/AbsoluteCutCornerShape), [AbsoluteRoundedCornerShape](https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/AbsoluteRoundedCornerShape), [CutCornerShape](https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CutCornerShape), [RoundedCornerShape](https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/RoundedCornerShape)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/AbsoluteCutCornerShape` | A shape describing the rectangle with cut corners. |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/AbsoluteRoundedCornerShape` | A shape describing the rectangle with rounded corners. |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CutCornerShape` | A shape describing the rectangle with cut corners. |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/RoundedCornerShape` | A shape describing the rectangle with rounded corners. |

*** ** * ** ***

Base class for `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape`s defined by four `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize`s.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/RoundedCornerShape` | for an example of the usage. |

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape#CornerBasedShape(androidx.compose.foundation.shape.CornerSize,androidx.compose.foundation.shape.CornerSize,androidx.compose.foundation.shape.CornerSize,androidx.compose.foundation.shape.CornerSize)( topStart: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize, topEnd: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize, bottomEnd: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize, bottomStart: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize )` | Cmn |

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape#copy(androidx.compose.foundation.shape.CornerSize)(all: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize)` Creates a copy of this Shape with a new corner size. | Cmn |
| `abstract https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape#copy(androidx.compose.foundation.shape.CornerSize,androidx.compose.foundation.shape.CornerSize,androidx.compose.foundation.shape.CornerSize,androidx.compose.foundation.shape.CornerSize)( topStart: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize, topEnd: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize, bottomEnd: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize, bottomStart: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize )` Creates a copy of this Shape with a new corner sizes. | Cmn |
| `final https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Outline` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape#createOutline(androidx.compose.ui.geometry.Size,androidx.compose.ui.unit.LayoutDirection,androidx.compose.ui.unit.Density)( size: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size, layoutDirection: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection, density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density )` Creates `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Outline` of this shape for the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape#createOutline(androidx.compose.ui.geometry.Size,androidx.compose.ui.unit.LayoutDirection,androidx.compose.ui.unit.Density)`. | Cmn |
| `abstract https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Outline` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape#createOutline(androidx.compose.ui.geometry.Size,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,androidx.compose.ui.unit.LayoutDirection)( size: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size, topStart: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, topEnd: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, bottomEnd: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, bottomStart: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, layoutDirection: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection )` Creates `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Outline` of this shape for the given `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape#createOutline(androidx.compose.ui.geometry.Size,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,androidx.compose.ui.unit.LayoutDirection)`. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape#lerp(kotlin.Any,kotlin.Float)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, t: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Default implementation. | Cmn |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape#bottomEnd()` a size of the bottom end corner | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape#bottomStart()` a size of the bottom start corner | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape#topEnd()` a size of the top end corner | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape#topStart()` a size of the top start corner | Cmn |

## Public constructors

### CornerBasedShape

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)

```
CornerBasedShape(
    topStart: CornerSize,
    topEnd: CornerSize,
    bottomEnd: CornerSize,
    bottomStart: CornerSize
)
```

| Parameters |
|---|---|
| `topStart: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize` | a size of the top start corner |
| `topEnd: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize` | a size of the top end corner |
| `bottomEnd: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize` | a size of the bottom end corner |
| `bottomStart: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize` | a size of the bottom start corner |

## Public functions

### copy

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)

```
fun copy(all: CornerSize): CornerBasedShape
```

Creates a copy of this Shape with a new corner size.

| Parameters |
|---|---|
| `all: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize` | a size to apply for all four corners |

### copy

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)

```
abstract fun copy(
    topStart: CornerSize = this.topStart,
    topEnd: CornerSize = this.topEnd,
    bottomEnd: CornerSize = this.bottomEnd,
    bottomStart: CornerSize = this.bottomStart
): CornerBasedShape
```

Creates a copy of this Shape with a new corner sizes.

| Parameters |
|---|---|
| `topStart: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize = this.topStart` | a size of the top start corner |
| `topEnd: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize = this.topEnd` | a size of the top end corner |
| `bottomEnd: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize = this.bottomEnd` | a size of the bottom end corner |
| `bottomStart: https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize = this.bottomStart` | a size of the bottom start corner |

### createOutline

Cmn Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.10.0)

```
final fun createOutline(
    size: Size,
    layoutDirection: LayoutDirection,
    density: Density
): Outline
```

Creates `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Outline` of this shape for the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape#createOutline(androidx.compose.ui.geometry.Size,androidx.compose.ui.unit.LayoutDirection,androidx.compose.ui.unit.Density)`.

| Parameters |
|---|---|
| `size: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size` | the size of the shape boundary. |
| `layoutDirection: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection` | the current layout direction. |
| `density: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density` | the current density of the screen. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Outline` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Outline` of this shape for the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape#createOutline(androidx.compose.ui.geometry.Size,androidx.compose.ui.unit.LayoutDirection,androidx.compose.ui.unit.Density)`. |

### createOutline

Cmn Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.10.0)

```
abstract fun createOutline(
    size: Size,
    topStart: Float,
    topEnd: Float,
    bottomEnd: Float,
    bottomStart: Float,
    layoutDirection: LayoutDirection
): Outline
```

Creates `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Outline` of this shape for the given `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape#createOutline(androidx.compose.ui.geometry.Size,kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float,androidx.compose.ui.unit.LayoutDirection)`.

| Parameters |
|---|---|
| `size: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size` | the size of the shape boundary. |
| `topStart: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the resolved size of the top start corner |
| `topEnd: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the resolved size for the top end corner |
| `bottomEnd: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the resolved size for the bottom end corner |
| `bottomStart: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | the resolved size for the bottom start corner |
| `layoutDirection: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection` | the current layout direction. |

### lerp

Cmn Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.10.0)

```
open fun lerp(other: Any?, t: Float): Any?
```

Default implementation. Returns null. Override this to get interpolatable benefits.

## Public properties

### bottomEnd

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)

```
val bottomEnd: CornerSize
```

a size of the bottom end corner

### bottomStart

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)

```
val bottomStart: CornerSize
```

a size of the bottom start corner

### topEnd

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)

```
val topEnd: CornerSize
```

a size of the top end corner

### topStart

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)

```
val topStart: CornerSize
```

a size of the top start corner