ColorBox

The ColorBox is a widget that allows an end user to enter a color or pick it out from the drop-down editor.

Included in: dx.web.js, dx.viz-web.js, dx.all.js
Module: ui/color_box
Export: default
ColorBox interactive configuration
Copy Code
Copy to Codepen
$("#colorbox").dxColorBox({
});

You can create the widget using one of the following approaches.

  • jQuery

    HTML
    <div id="colorBox"></div>
    JavaScript
    $(function () {
        $("#colorBox").dxColorBox({
            value: 'rgba(255, 144, 0, 0.3)',
            editAlphaChannel: true
        });
    });
  • Angular

    HTML
    <dx-color-box
        [value]="rgba(255, 144, 0, 0.3)"
        [editAlphaChannel]="true">
    </dx-color-box>
  • AngularJS

    HTML
    <div dx-color-box="{
        value: 'rgba(255, 144, 0, 0.3)',
        editAlphaChannel: true
    }"></div>
  • Knockout

    HTML
    <div data-bind="dxColorBox: {
        value: 'rgba(255, 144, 0, 0.3)',
        editAlphaChannel: true
    }"></div>
  • ASP.NET MVC Wrappers

    Razor C#
    Razor VB
    @(Html.DevExtreme().ColorBox()
        .ID("colorBox")
        .Value("rgba(255, 144, 0, 0.3)")
        .EditAlphaChannel(true)
    )
    @(Html.DevExtreme().ColorBox() _
        .ID("colorBox") _
        .Value("rgba(255, 144, 0, 0.3)") _
        .EditAlphaChannel(True)
    )

Note that DevExtreme widgets require you to link the jQuery library to your application. If you use the Knockout or AngularJS approach, the Knockout or AngularJS library is also required. For detailed information on linking these libraries to your project, refer to the topics in the Installation section.

View Demo

See Also
Show Example:
AngularJS
Knockout
jQuery

Configuration

An object defining configuration options for the ColorBox widget.

Methods

This section describes members used to manipulate the widget.

Events

This section describes events fired by this widget.