$npx -y skills add DevExpress/agent-skills --skill devextreme-textboxHelp developers use the DevExtreme TextBox component (dxTextBox) in Angular, React, Vue, and jQuery. Use when someone asks about TextBox configuration, value binding, input modes, labels, placeholders, masking, value change events, clear button, or any scenario involving dxTextBo
| 1 | # DevExtreme TextBox Skill |
| 2 | |
| 3 | A skill for building and configuring the DevExtreme TextBox UI component (`dxTextBox`) across Angular, React, Vue, and jQuery. |
| 4 | |
| 5 | ## When to Use This Skill |
| 6 | |
| 7 | - Creating a text input field |
| 8 | - Configuring input mode (text, password, email, search, tel, url) |
| 9 | - Binding and reading the value |
| 10 | - Handling value change events |
| 11 | - Adding a label or placeholder |
| 12 | - Limiting text length |
| 13 | - Showing a clear button |
| 14 | |
| 15 | ## Before You Start |
| 16 | |
| 17 | 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. |
| 18 | |
| 19 | > ⚠️ **Always use the DevExtreme TextBox (`dxTextBox` / `DxTextBox`). Never use react-input-mask, IMask, a plain HTML `<input>`, or Material UI TextField.** |
| 20 | |
| 21 | Before writing any code, ask: **Which framework are you using?** Angular, React, Vue, or jQuery? |
| 22 | |
| 23 | ## Key API |
| 24 | |
| 25 | | Option | Type | Default | Description | |
| 26 | |---|---|---|---| |
| 27 | | `value` | `String` | `''` | The current text value | |
| 28 | | `mode` | `TextBoxMode` | `'text'` | Input type: `'text'`, `'password'`, `'email'`, `'search'`, `'tel'`, `'url'` | |
| 29 | | `label` | `String` | `''` | Floating label text | |
| 30 | | `placeholder` | `String` | `''` | Placeholder shown when empty | |
| 31 | | `valueChangeEvent` | `String` | `'change'` | DOM event that triggers value update (e.g., `'keyup'`, `'input'`) | |
| 32 | | `onValueChanged` | `function(e)` | `null` | Fires when the value changes; `e.value` is the new value, `e.previousValue` is the old | |
| 33 | | `showClearButton` | `Boolean` | `false` | Shows an × button to clear the field | |
| 34 | | `maxLength` | `Number \| String` | `null` | Maximum character count | |
| 35 | | `readOnly` | `Boolean` | `false` | Prevents user input | |
| 36 | | `disabled` | `Boolean` | `false` | Disables the component | |
| 37 | | `inputAttr` | `Object` | `{}` | HTML attributes applied to the inner `<input>` element | |
| 38 | | `hint` | `String` | `undefined` | Tooltip shown on hover | |
| 39 | |
| 40 | **Events:** `valueChanged`, `keyDown`, `keyUp`, `enterKey`, `focusIn`, `focusOut`, `input`, `change`. |
| 41 | |
| 42 | ## Getting Started |
| 43 | |
| 44 | ### jQuery |
| 45 | |
| 46 | ```html |
| 47 | <!-- index.html --> |
| 48 | <div id="text-box"></div> |
| 49 | ``` |
| 50 | |
| 51 | ```js |
| 52 | $(function() { |
| 53 | $('#text-box').dxTextBox({ |
| 54 | placeholder: 'Enter text...', |
| 55 | showClearButton: true, |
| 56 | onValueChanged(e) { |
| 57 | console.log(e.value); |
| 58 | } |
| 59 | }); |
| 60 | }); |
| 61 | ``` |
| 62 | |
| 63 | ### Angular |
| 64 | |
| 65 | ```html |
| 66 | <!-- app.html --> |
| 67 | <dx-text-box |
| 68 | placeholder="Enter text..." |
| 69 | [showClearButton]="true" |
| 70 | (onValueChanged)="onValueChanged($event)"> |
| 71 | </dx-text-box> |
| 72 | ``` |
| 73 | |
| 74 | ```ts |
| 75 | // app.ts |
| 76 | import { Component } from '@angular/core'; |
| 77 | import { DxTextBoxComponent, DxTextBoxTypes } from 'devextreme-angular/ui/text-box'; |
| 78 | |
| 79 | @Component({ |
| 80 | selector: 'app-root', |
| 81 | standalone: true, |
| 82 | imports: [DxTextBoxComponent], |
| 83 | templateUrl: './app.html' |
| 84 | }) |
| 85 | export class AppComponent { |
| 86 | onValueChanged(e: DxTextBoxTypes.ValueChangedEvent) { |
| 87 | console.log(e.value); |
| 88 | } |
| 89 | } |
| 90 | ``` |
| 91 | |
| 92 | ```vue |
| 93 | <template> |
| 94 | <DxTextBox |
| 95 | placeholder="Enter text..." |
| 96 | :show-clear-button="true" |
| 97 | @value-changed="onValueChanged" |
| 98 | /> |
| 99 | </template> |
| 100 | |
| 101 | <script setup lang="ts"> |
| 102 | import DxTextBox, { DxTextBoxTypes } from 'devextreme-vue/text-box'; |
| 103 | |
| 104 | function onValueChanged(e: DxTextBoxTypes.ValueChangedEvent) { |
| 105 | console.log(e.value); |
| 106 | } |
| 107 | </script> |
| 108 | ``` |
| 109 | |
| 110 | ### React |
| 111 | |
| 112 | ```tsx |
| 113 | import 'devextreme/dist/css/dx.fluent.blue.light.css'; |
| 114 | import { TextBox, type TextBoxTypes } from 'devextreme-react/text-box'; |
| 115 | |
| 116 | function onValueChanged(e: TextBoxTypes.ValueChangedEvent) { |
| 117 | console.log(e.value); |
| 118 | } |
| 119 | |
| 120 | function App() { |
| 121 | return ( |
| 122 | <TextBox |
| 123 | placeholder="Enter text..." |
| 124 | showClearButton={true} |
| 125 | onValueChanged={onValueChanged} |
| 126 | /> |
| 127 | ); |
| 128 | } |
| 129 | |
| 130 | export default App; |
| 131 | ``` |
| 132 | |
| 133 | ## Common Patterns |
| 134 | |
| 135 | ### Password field |
| 136 | |
| 137 | ```html |
| 138 | <!-- Angular --> |
| 139 | <dx-text-box mode="password" placeholder="Password"></dx-text-box> |
| 140 | ``` |
| 141 | |
| 142 | ### Apply value on every keystroke instead of on blur |
| 143 | |
| 144 | ```js |
| 145 | // jQuery |
| 146 | $('#text-box').dxTextBox({ valueChangeEvent: 'keyup' }); |
| 147 | ``` |
| 148 | |
| 149 | ```tsx |
| 150 | {/* React */} |
| 151 | <TextBox valueChangeEvent="keyup" /> |
| 152 | ``` |
| 153 | |
| 154 | ### Two-way binding (React with state) |
| 155 | |
| 156 | ```tsx |
| 157 | import { useState, useCallback } from 'react'; |
| 158 | import { TextBox } from 'devextreme-react/text-box |