Skip to main content
Version: 1.14.0

Shapes

Most Components accept a Shape implementation, directly or indirectly. Here are the implementations included in the library. You can write your own Shape implementations to draw entirely custom shapes.

Shape-implementing classes

There are three classes that implement Shape: CorneredShape, DashedShape, and MarkerCorneredShape. These cover most use cases.

Helpers

Vico offers helpers for quickly creating certain Shape implementations. These either instantiate one of the classes mentioned above or use anonymous inner classes that implement Shape. The helpers are available via the Shapes object. Notably, drawableShape allows for using a Drawable as a Shape. For Jetpack Compose, see roundedCornerShape, cutCornerShape, dashedShape, and markerCorneredShape. See ShapePreviews.kt in the sample app for examples.