# Shape

Artifact: [androidx.compose.ui:ui-graphics](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/graphics/Shape.kt+class:androidx.compose.ui.graphics.Shape) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- Cmn

  ```
  interface Shape
  ```
Known direct subclasses [CornerBasedShape](https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape), [DefaultTooltipCaretShape](https://developer.android.com/reference/kotlin/androidx/compose/material3/DefaultTooltipCaretShape), [GenericShape](https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/GenericShape), [PolygonShape](https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/PolygonShape)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerBasedShape` | 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. |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/DefaultTooltipCaretShape` | Default `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape` of the caret used by tooltips. |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/GenericShape` | Creates `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape` defined by applying the provided `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/GenericShape#(kotlin.Function3)` on a `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Path`. |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/PolygonShape` | Defines a `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shape` built from rounded polygon geometry. |

Known indirect 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. |

*** ** * ** ***

Defines a generic shape.

## Summary

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Outline` | `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)( 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 |

## Public functions

### createOutline

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

```
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)`. |