> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: selectBackground()

## Article: selectBackground()

## Article Link: https://dev.wix.com/docs/sdk/host-modules/editor/react-elements/pickers/select-background.md

## Article Content:

<!-- Source: packages/public-editor-platform-sdk/src/element/index.ts in wix-private/editor-platform -->
# selectBackground()

Opens the editor's background picker for the selected component, letting a Wix user choose a background fill made up of a color, gradient, or image.

## Syntax

```ts
function selectBackground(options: BackgroundPickerOptions): Promise<void>
```

## Parameters

| Name | Type | Description |
| :---- | :---- | :---- |
| `initialValue` | object | Initial background value to show when the picker opens. |
| `onChange` | function | Called with the updated background value as the Wix user interacts with the picker. |

## Returns

`Promise<void>`

Use the `onChange` callback to receive background values as the Wix user interacts with the picker, and apply them yourself with [`setStyles()`](https://dev.wix.com/docs/sdk/host-modules/editor/react-elements/styles/set-styles.md).

## Example

```js
import { reactElements } from '@wix/editor';

reactElements.selectBackground({
  initialValue: { backgroundColor: '#ffffff' },
  onChange: (value) => {
    reactElements.setStyles({ cssProperties: { background: value } });
  },
});
```

## See also

- [setStyles()](https://dev.wix.com/docs/sdk/host-modules/editor/react-elements/styles/set-styles.md)
- [selectColor()](https://dev.wix.com/docs/sdk/host-modules/editor/react-elements/pickers/select-color.md)
- [About the React Elements API](https://dev.wix.com/docs/sdk/host-modules/editor/react-elements/introduction.md)