class Shapes


Material surfaces can be displayed in different shapes. Shapes direct attention, identify components, communicate state, and express brand.

The shape scale defines the style of container, offering a range of curved shapes (mostly polygonal). The default Shapes theme for Material3 is rounded rectangles, with various degrees of corner roundness:

  • Extra Small

  • Small

  • Medium

  • Large

  • Extra Large

You can customize the shape system for all components in the MaterialTheme or you can do it on a per component basis by overriding the shape parameter for that component. For example, by default, buttons use the shape style "large". If your product requires a smaller amount of roundness, you can override the shape parameter with a different shape value like Shapes.small.

Summary

Public constructors

Shapes(
    extraSmall: CornerBasedShape,
    small: CornerBasedShape,
    medium: CornerBasedShape,
    large: CornerBasedShape,
    extraLarge: CornerBasedShape
)

Public functions

Shapes
copy(
    extraSmall: CornerBasedShape,
    small: CornerBasedShape,
    medium: CornerBasedShape,
    large: CornerBasedShape,
    extraLarge: CornerBasedShape
)

Returns a copy of this Shapes, optionally overriding some of the values.

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

CornerBasedShape

By default, provides ShapeDefaults.ExtraLarge, a RoundedCornerShape with 36dp CornerSize.

CornerBasedShape

By default, provides ShapeDefaults.ExtraSmall, a RoundedCornerShape with 4dp CornerSize (used by bundled Cards).

CornerBasedShape

By default, provides ShapeDefaults.Large, a RoundedCornerShape with 26dp CornerSize (used by Cards).

CornerBasedShape

By default, provides ShapeDefaults.Medium, a RoundedCornerShape with 18dp CornerSize (used by shape-shifting Buttons and rounded rectangle buttons).

CornerBasedShape

By default, provides ShapeDefaults.Small, a RoundedCornerShape with 8dp CornerSize.

Public constructors

Shapes

Added in 1.0.0-alpha29
Shapes(
    extraSmall: CornerBasedShape = ShapeDefaults.ExtraSmall,
    small: CornerBasedShape = ShapeDefaults.Small,
    medium: CornerBasedShape = ShapeDefaults.Medium,
    large: CornerBasedShape = ShapeDefaults.Large,
    extraLarge: CornerBasedShape = ShapeDefaults.ExtraLarge
)
Parameters
extraSmall: CornerBasedShape = ShapeDefaults.ExtraSmall

By default, provides ShapeDefaults.ExtraSmall, a RoundedCornerShape with 4dp CornerSize (used by bundled Cards).

small: CornerBasedShape = ShapeDefaults.Small

By default, provides ShapeDefaults.Small, a RoundedCornerShape with 8dp CornerSize.

medium: CornerBasedShape = ShapeDefaults.Medium

By default, provides ShapeDefaults.Medium, a RoundedCornerShape with 18dp CornerSize (used by shape-shifting Buttons and rounded rectangle buttons).

large: CornerBasedShape = ShapeDefaults.Large

By default, provides ShapeDefaults.Large, a RoundedCornerShape with 26dp CornerSize (used by Cards).

extraLarge: CornerBasedShape = ShapeDefaults.ExtraLarge

By default, provides ShapeDefaults.ExtraLarge, a RoundedCornerShape with 36dp CornerSize.

Public functions

copy

Added in 1.0.0-alpha29
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.

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

extraLarge

Added in 1.0.0-alpha29
val extraLargeCornerBasedShape

By default, provides ShapeDefaults.ExtraLarge, a RoundedCornerShape with 36dp CornerSize.

extraSmall

Added in 1.0.0-alpha29
val extraSmallCornerBasedShape

By default, provides ShapeDefaults.ExtraSmall, a RoundedCornerShape with 4dp CornerSize (used by bundled Cards).

large

Added in 1.0.0-alpha29
val largeCornerBasedShape

By default, provides ShapeDefaults.Large, a RoundedCornerShape with 26dp CornerSize (used by Cards).

medium

Added in 1.0.0-alpha29
val mediumCornerBasedShape

By default, provides ShapeDefaults.Medium, a RoundedCornerShape with 18dp CornerSize (used by shape-shifting Buttons and rounded rectangle buttons).

small

Added in 1.0.0-alpha29
val smallCornerBasedShape

By default, provides ShapeDefaults.Small, a RoundedCornerShape with 8dp CornerSize.