Background Control

Elementor background group control displays input fields to define the background including the background color, background image, background gradient or background video.

The control is defined in Group_Control_Background class which extends Group_Control_Base class.

Note that when using group controls, the type should be set using the Group_Control_Background::get_type() method.


Name Type Default Description
type string background The type of the control.
label string The label that appears above of the field.
description string The description that appears below the field.
show_label bool true Whether to display the label.
label_block bool false Whether to display the label in a separate line.
separator string default Set the position of the control separator. Available values are defaultbeforeafter and nonedefault will position the separator depending on the control type. before / after will position the separator before/after the control. none will hide the separator.
types array The specific background types to use. Available types are classic, gradient and video. Default is an empty array, including all the types.
fields_options array An array of arrays containing data that overrides control settings.

Return Value

(array) An array containing the background values.


class Elementor_Test_Widget extends \Elementor\Widget_Base {

	protected function _register_controls() {

				'label' => __( 'Content', 'plugin-name' ),
				'tab' => \Elementor\Controls_Manager::TAB_CONTENT,

				'name' => 'background',
				'label' => __( 'Background', 'plugin-domain' ),
				'types' => [ 'classic', 'gradient', 'video' ],
				'selector' => '{{WRAPPER}} .wrapper',



	protected function render() {
		$settings = $this->get_settings_for_display();
		echo '<div class="wrapper"> ... </div>';

	protected function _content_template() {
		<div class="wrapper"> ... </div>



  • Video background is only supported at section level, not widgets.

Never miss an update
Subscribe to our developer’s newsletter for every latest update