---
title: "Shadow"
description: "Group of parameters that represent how a drop shadow or inner shadow should be rendered."
type: "class"
---

<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
class Shadow
internal constructor(
    val radius: Dp,
    val spread: Dp,
    val offset: DpOffset,
    color: Color,
    brush: Brush?,
    @FloatRange(from = 0.0, to = 1.0) alpha: Float,
    val blendMode: BlendMode,
)
```


Group of parameters that represent how a drop shadow or inner shadow should be rendered.


## Secondary Constructors

```kotlin
constructor(
    radius: Dp,
    brush: Brush,
    spread: Dp = 0.dp,
    offset: DpOffset = DpOffset.Zero,
    @FloatRange(from = 0.0, to = 1.0) alpha: Float = 1f,
    blendMode: BlendMode = DefaultBlendMode,
) : this(
    radius = radius,
    spread = spread,
    offset = offset,
    color = Color.Black,
    brush = brush,
    alpha = alpha,
    blendMode = blendMode,
)
```


Creates a group of parameters that represent how a drop shadow or inner shadow should be
rendered.

#### Parameters

| | |
| --- | --- |
| radius | The blur radius of the shadow |
| brush | Brush used to blend against a mask defined by the shadow geometry |
| spread | Optional parameter to grow the shadow geometry by |
| offset | Optional parameter to offset the shadow within the geometry bounds |
| alpha | Optional opacity of the shadow |
| blendMode | Optional blending algorithm used by the shadow |



```kotlin
constructor(
    radius: Dp,
    color: Color = Color.Black,
    spread: Dp = 0.dp,
    offset: DpOffset = DpOffset.Zero,
    @FloatRange(from = 0.0, to = 1.0) alpha: Float = 1f,
    blendMode: BlendMode = DefaultBlendMode,
) : this(
    radius = radius,
    spread = spread,
    offset = offset,
    color = if (color.isSpecified) color else Color.Black,
    brush = null,
    alpha = alpha,
    blendMode = blendMode,
)
```


Creates a group of parameters that represent how a drop shadow or inner shadow should be
rendered.

#### Parameters

| | |
| --- | --- |
| radius | The blur radius of the shadow |
| color | The color of the shadow. If `Color.Unspecified` is provided, `Color.Black` will be used as a default. |
| spread | Optional parameter to grow the shadow geometry by |
| offset | Optional parameter to offset the shadow within the geometry bounds |
| alpha | Optional opacity of the shadow |
| blendMode | Optional blending algorithm used by the shadow |



## Properties

<div class='sourceset sourceset-common'>Common</div>


```kotlin
val color: Color
```


Color of the shadow. If `Color.Unspecified` is provided, `Color.Black` will be used as a
default. This color is only used if `brush` is null.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
val brush: Brush?
```


Optional brush to render the shadow with.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
val alpha: Float
```


Opacity of the shadow



<div class='sourceset sourceset-common'>Common</div>


```kotlin
class Shadow(
    @Stable val color: Color = Color(0xFF000000),
    @Stable val offset: Offset = Offset.Zero,
    @Stable val blurRadius: Float = 0.0f,
)
```


A single shadow.


## Functions

```kotlin
fun copy(
        color: Color = this.color,
        offset: Offset = this.offset,
        blurRadius: Float = this.blurRadius,
    ): Shadow
```

## Companion Object

#### Properties

<div class='sourceset sourceset-common'>Common</div>


```kotlin
val None = Shadow()
```


Constant for no shadow.





