Shadow

A modifier used for applying a shadow to a composable

View in Playground

Constructors

Modifier.drawShadow(12.dp, RectangleShape)
  • elevation - the elevation to be applied when drawing the shadow

  • shape - the shape to be applied when drawing the shadow

  • clipToOutline - whether or not the shadow should be clipped to the outline of the shape

  • opacity - the opacity to be applied when drawing the shadow

Examples

Box(
    modifier = Modifier.preferredSize(100.dp, 100.dp).drawShadow(12.dp, RectangleShape),
    backgroundColor = Color.Green
)

Shadow