Vue ColorBox - Overview

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

View Demo

The following code adds a simple ColorBox to your page.

App.vue
  • <template>
  • <DxColorBox
  • :value.sync="color"
  • />
  • </template>
  •  
  • <script>
  • import 'devextreme/dist/css/dx.common.css';
  • import 'devextreme/dist/css/dx.light.css';
  •  
  • import DxColorBox from 'devextreme-vue/color-box';
  •  
  • export default {
  • components: {
  • DxColorBox
  • },
  • data() {
  • return {
  • color: "#FF0000"
  • };
  • }
  • }
  • </script>

The ColorBox accepts colors in hexadecimal ("#FF0000"), RGB ("rgb(255, 0, 0)") and RGBA ("rgba(255, 0, 0, 1)") formats, as well as color names. When an end user selects a color from the drop-down editor, the textual representation of the selected color is hexadecimal.

See Also