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({
});

                    

DevExtreme widgets are integrated with many popular libraries and frameworks. See the Installation section (for JavaScript libraries) or the Prerequisites and Installation section (for ASP.NET MVC framework) to find details on setting up DevExtreme with a particular library or framework.

The following code shows how to create the ColorBox widget using every supported library and framework. For more details on working with widgets in these libraries and frameworks, see the Widget Basics topic for jQuery, Angular, AngularJS, Knockout or ASP.NET MVC.

jQuery
JavaScript
HTML
$(function () {
    $("#colorBox").dxColorBox({
        value: 'rgba(255, 144, 0, 0.3)',
        editAlphaChannel: true
    });
});
<div id="colorBox"></div>
Angular
HTML
TypeScript
<dx-color-box
    value="rgba(255, 144, 0, 0.3)"
    [editAlphaChannel]="true">
</dx-color-box>
import { DxColorBoxModule } from 'devextreme-angular';
// ...
export class AppComponent {
    // ...
}
@NgModule({
    imports: [
        // ...
        DxColorBoxModule
    ],
    // ...
})
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 Controls
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)
)

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 that this widget raises.

See Also