androidx.compose.material3
Shapes
Class
The set of shapes in the theme. Read it with MaterialTheme.shapes.
Components use these values by default, so changing them changes the look of the whole app.
MaterialTheme(shapes = Shapes(medium = RoundedCornerShape(6.dp))) { /* app */ }
Every value is a CornerBasedShape, so you can pass it to any shape parameter.
See the Shapes guide.
class Shapes(
extraSmall: CornerBasedShape = ShapeDefaults.ExtraSmall,
small: CornerBasedShape = ShapeDefaults.Small,
medium: CornerBasedShape = ShapeDefaults.Medium,
large: CornerBasedShape = ShapeDefaults.Large,
extraLarge: CornerBasedShape = ShapeDefaults.ExtraLarge,
largeIncreased: CornerBasedShape = ShapeDefaults.LargeIncreased,
extraLargeIncreased: CornerBasedShape = ShapeDefaults.ExtraLargeIncreased,
extraExtraLarge: CornerBasedShape = ShapeDefaults.ExtraExtraLarge,
)
How to get one
Create it
Shapes(extraSmall, small, medium, large, extraLarge, largeIncreased, extraLargeIncreased, extraExtraLarge)constructor
Ready-made values and functions that return it
Used by
Parameters that take a Shapes.
Properties
largeIncreasedSince 1.10
val largeIncreased: CornerBasedShape
20 dp corners by default. Part of Expressive.
extraLargeIncreasedSince 1.10
val extraLargeIncreased: CornerBasedShape
32 dp corners by default. Part of Expressive.
extraExtraLargeSince 1.10
val extraExtraLarge: CornerBasedShape
48 dp corners by default. Part of Expressive.
extraSmall
val extraSmall: CornerBasedShape
4 dp corners by default.
small
val small: CornerBasedShape
8 dp corners by default.
medium
val medium: CornerBasedShape
12 dp corners by default.
large
val large: CornerBasedShape
16 dp corners by default.
extraLarge
val extraLarge: CornerBasedShape
28 dp corners by default.
Functions
copy
fun copy(
extraSmall: CornerBasedShape = this.extraSmall,
small: CornerBasedShape = this.small,
medium: CornerBasedShape = this.medium,
large: CornerBasedShape = this.large,
extraLarge: CornerBasedShape = this.extraLarge,
largeIncreased: CornerBasedShape = this.largeIncreased,
extraLargeIncreased: CornerBasedShape = this.extraLargeIncreased,
extraExtraLarge: CornerBasedShape = this.extraExtraLarge,
): Shapes
Returns a copy of this Shapes, optionally overriding some of the values.
fun copy(
extraSmall: CornerBasedShape = this.extraSmall,
small: CornerBasedShape = this.small,
medium: CornerBasedShape = this.medium,
large: CornerBasedShape = this.large,
extraLarge: CornerBasedShape = this.extraLarge,
): Shapes
Returns a copy of this Shapes, optionally overriding some of the values.