---
title: "BackgroundScope"
description: "An interface that introduces the background property to a Style receiver scope."
type: "interface"
lastmod: "2026-05-20T01:13:53.359303Z"
---
## API Reference

> Source set: Common

```kotlin
@ExperimentalFoundationStyleApi
interface BackgroundScope
```

An interface that introduces the [background](/jetpack-compose/androidx.compose.foundation/foundation/modifiers/background) property to a [Style](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/Style) receiver scope.

## Functions

### background

```kotlin
fun background(color: Color)
```

Sets the background color of the component. If a [ShapeScope.shape](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/ShapeScope) is applied, the
background will fill that shape.

Setting a background color will override any previously set background brush.

This property is *not* inherited

#### Parameters

| | |
| --- | --- |
| color | The background color. |

### background

```kotlin
fun background(value: Brush)
```

Sets the background of the component using a [Brush](/jetpack-compose/androidx.compose.ui/ui-graphics/classes/Brush). This allows for gradient backgrounds or
other complex fills. If a [ShapeScope.shape](/jetpack-compose/androidx.compose.foundation/foundation/interfaces/ShapeScope) is applied, the background will fill that shape.

Setting a background brush will override any previously set background color.

This property is *not* inherited

#### Parameters

| | |
| --- | --- |
| value | The brush to use for the background. |
