$npx -y skills add DevExpress/agent-skills --skill devextreme-checkboxHelp developers use the DevExtreme CheckBox component (dxCheckBox) in Angular, React, Vue, and jQuery. Use when someone asks about CheckBox configuration, value states, three-state behavior, labels, value change events, or any scenario involving dxCheckBox or DxCheckBox. Trigger
| 1 | # DevExtreme CheckBox Skill |
| 2 | |
| 3 | A skill for building and configuring the DevExtreme CheckBox UI component (`dxCheckBox`) across Angular, React, Vue, and jQuery. |
| 4 | |
| 5 | ## When to Use This Skill |
| 6 | |
| 7 | - Creating a boolean toggle input |
| 8 | - Setting an initial checked/unchecked/indeterminate state |
| 9 | - Enabling three-state behavior (checked / unchecked / indeterminate) |
| 10 | - Handling value change events |
| 11 | - Adding a label or tooltip |
| 12 | |
| 13 | ## Before You Start |
| 14 | |
| 15 | If the host agent has a structured question-asking tool available, use it to ask these questions one at a time with clear options — for example, Claude Code's `AskUserQuestion` tool or GitHub Copilot's `askQuestions` tool. If no such tool is available, ask the questions directly in the chat response before generating code. |
| 16 | |
| 17 | > ⚠️ **Always use the DevExtreme CheckBox (`dxCheckBox` / `DxCheckBox`). Never use a plain HTML `<input type="checkbox">`, Material UI Checkbox, Ant Design Checkbox, or any other library.** |
| 18 | |
| 19 | Before writing any code, ask: **Which framework are you using?** Angular, React, Vue, or jQuery? |
| 20 | |
| 21 | ## Key API |
| 22 | |
| 23 | | Option | Type | Default | Description | |
| 24 | |---|---|---|---| |
| 25 | | `value` | `Boolean \| null \| undefined` | `false` | `true` = checked, `false` = unchecked, `null`/`undefined` = indeterminate | |
| 26 | | `text` | `String` | `''` | Label displayed next to the checkbox | |
| 27 | | `enableThreeStateBehavior` | `Boolean` | `false` | Lets users cycle through checked → unchecked → indeterminate | |
| 28 | | `onValueChanged` | `function(e)` | `null` | Fires when the value changes; `e.value` is the new value | |
| 29 | | `disabled` | `Boolean` | `false` | Disables the component | |
| 30 | | `readOnly` | `Boolean` | `false` | Prevents user interaction | |
| 31 | | `iconSize` | `Number \| String` | `undefined` | Custom width and height of the checkbox icon | |
| 32 | | `hint` | `String` | `undefined` | Tooltip shown on hover | |
| 33 | |
| 34 | **Event:** `valueChanged` — use `onValueChanged` as the handler. |
| 35 | |
| 36 | ## Getting Started |
| 37 | |
| 38 | ### jQuery |
| 39 | |
| 40 | ```html |
| 41 | <!-- index.html --> |
| 42 | <div id="check-box"></div> |
| 43 | ``` |
| 44 | |
| 45 | ```js |
| 46 | $(function() { |
| 47 | $('#check-box').dxCheckBox({ |
| 48 | value: false, |
| 49 | text: 'Agree to terms', |
| 50 | onValueChanged(e) { |
| 51 | console.log(e.value); |
| 52 | } |
| 53 | }); |
| 54 | }); |
| 55 | ``` |
| 56 | |
| 57 | ### Angular |
| 58 | |
| 59 | ```html |
| 60 | <!-- app.html --> |
| 61 | <dx-check-box |
| 62 | [value]="false" |
| 63 | text="Agree to terms" |
| 64 | (onValueChanged)="onValueChanged($event)"> |
| 65 | </dx-check-box> |
| 66 | ``` |
| 67 | |
| 68 | ```ts |
| 69 | // app.ts |
| 70 | import { Component } from '@angular/core'; |
| 71 | import { DxCheckBoxComponent, DxCheckBoxTypes } from 'devextreme-angular/ui/check-box'; |
| 72 | |
| 73 | @Component({ |
| 74 | selector: 'app-root', |
| 75 | standalone: true, |
| 76 | imports: [DxCheckBoxComponent], |
| 77 | templateUrl: './app.html' |
| 78 | }) |
| 79 | export class AppComponent { |
| 80 | onValueChanged(e: DxCheckBoxTypes.ValueChangedEvent) { |
| 81 | console.log(e.value); |
| 82 | } |
| 83 | } |
| 84 | ``` |
| 85 | |
| 86 | ### Vue |
| 87 | |
| 88 | ```vue |
| 89 | <template> |
| 90 | <DxCheckBox |
| 91 | :value="false" |
| 92 | text="Agree to terms" |
| 93 | @value-changed="onValueChanged" |
| 94 | /> |
| 95 | </template> |
| 96 | |
| 97 | <script setup lang="ts"> |
| 98 | import DxCheckBox, { DxCheckBoxTypes } from 'devextreme-vue/check-box'; |
| 99 | |
| 100 | function onValueChanged(e: DxCheckBoxTypes.ValueChangedEvent) { |
| 101 | console.log(e.value); |
| 102 | } |
| 103 | </script> |
| 104 | ``` |
| 105 | |
| 106 | ### React |
| 107 | |
| 108 | ```tsx |
| 109 | import 'devextreme/dist/css/dx.fluent.blue.light.css'; |
| 110 | import { CheckBox, type CheckBoxTypes } from 'devextreme-react/check-box'; |
| 111 | |
| 112 | function onValueChanged(e: CheckBoxTypes.ValueChangedEvent) { |
| 113 | console.log(e.value); |
| 114 | } |
| 115 | |
| 116 | function App() { |
| 117 | return ( |
| 118 | // defaultValue = uncontrolled (no state needed); use value + useState for two-way binding |
| 119 | <CheckBox |
| 120 | defaultValue={false} |
| 121 | text="Agree to terms" |
| 122 | onValueChanged={onValueChanged} |
| 123 | /> |
| 124 | ); |
| 125 | } |
| 126 | |
| 127 | export default App; |
| 128 | ``` |
| 129 | |
| 130 | ## Common Patterns |
| 131 | |
| 132 | ### Three-state checkbox (indeterminate state) |
| 133 | |
| 134 | ```tsx |
| 135 | {/* React */} |
| 136 | <CheckBox |
| 137 | value={null} |
| 138 | enableThreeStateBehavior={true} |
| 139 | text="Select all" |
| 140 | /> |
| 141 | ``` |
| 142 | |
| 143 | ### Two-way binding (React with state) |
| 144 | |
| 145 | ```tsx |
| 146 | import { useState, useCallback } from 'react'; |
| 147 | import { CheckBox } from 'devextreme-react/check-box'; |
| 148 | |
| 149 | function App() { |
| 150 | const [checked, setChecked] = useState(false); |
| 151 | const handleValueChanged = useCallback((e) => setChecked(e.value), []); |
| 152 | |
| 153 | return ( |
| 154 | <CheckBox |
| 155 | value={checked} |
| 156 | onValueChanged={handleValueChanged} |
| 157 | text="Enable feature" |
| 158 | /> |
| 159 | ); |
| 160 | } |
| 161 | ``` |
| 162 | |
| 163 | ### Custom icon size and hint |
| 164 | |
| 165 | ```html |
| 166 | <!-- |