← Components / Shapes

Material shape

The expressive shape library. Use shapes for avatars, image masks, decorations and state changes: changing the shape morphs it on the M3 spatial spring.

SwiftUIReact Native · Coming soonFlutter · Coming soon

Usage

SwiftUI
M3EMaterialShape(liked ? .heart : .circle).frame(width: 64)
M3EMaterialShape(.softBurst, spinDuration: 20).frame(width: 48)
Image("avatar").resizable().clipShape(M3EShape.cookie9Sided)

API

PropertySwiftUIDescription
shapeM3EShapeOne of 35 shapes; changing it morphs.
colorcolor: Color?Fill; primary by default.
rotationrotation: DoubleDegrees.
spinDurationspinDuration: Double (s)Continuous spin; runs on the platform's animation layer.
motionmotion: M3ESpatialSpringMorph spring.

Guidelines

  • Use a few shapes with intent; one strong shape beats many.
  • Keep text off busy shapes like burst and boom.