Shapes
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( |
Public functions |
|
|---|---|
Shapes |
copy(Returns a copy of this Shapes, optionally overriding some of the values. |
open operator Boolean |
|
open Int |
hashCode() |
open String |
toString() |
Public properties |
|
|---|---|
CornerBasedShape |
By default, provides |
CornerBasedShape |
By default, provides |
CornerBasedShape |
By default, provides |
CornerBasedShape |
By default, provides |
CornerBasedShape |
By default, provides |
Public constructors
Shapes
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 |
small: CornerBasedShape = ShapeDefaults.Small |
By default, provides |
medium: CornerBasedShape = ShapeDefaults.Medium |
By default, provides |
large: CornerBasedShape = ShapeDefaults.Large |
By default, provides |
extraLarge: CornerBasedShape = ShapeDefaults.ExtraLarge |
By default, provides |
Public functions
copy
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.
Public properties
extraLarge
val extraLarge: CornerBasedShape
By default, provides ShapeDefaults.ExtraLarge, a RoundedCornerShape with 36dp CornerSize.
extraSmall
val extraSmall: CornerBasedShape
By default, provides ShapeDefaults.ExtraSmall, a RoundedCornerShape with 4dp CornerSize (used by bundled Cards).
large
val large: CornerBasedShape
By default, provides ShapeDefaults.Large, a RoundedCornerShape with 26dp CornerSize (used by Cards).
medium
val medium: CornerBasedShape
By default, provides ShapeDefaults.Medium, a RoundedCornerShape with 18dp CornerSize (used by shape-shifting Buttons and rounded rectangle buttons).
small
val small: CornerBasedShape
By default, provides ShapeDefaults.Small, a RoundedCornerShape with 8dp CornerSize.