$npx -y skills add DevExpress/agent-skills --skill devextreme-buttonHelp developers use the DevExtreme Button component (dxButton) in Angular, React, Vue, and jQuery. Use when someone asks about Button configuration, click handling, icons, styling, button types, form submission, validation, custom templates, or any scenario involving dxButton or
| 1 | # DevExtreme Button Skill |
| 2 | |
| 3 | A skill for building and configuring the DevExtreme Button UI component (`dxButton`) across Angular, React, Vue, and jQuery. |
| 4 | |
| 5 | ## When to Use This Skill |
| 6 | |
| 7 | - Creating a basic or styled Button |
| 8 | - Handling click events |
| 9 | - Adding icons to a Button |
| 10 | - Changing the button type or styling mode |
| 11 | - Submitting and validating an HTML form with a Button |
| 12 | - Managing Button state (disabled, active, hover, focus) |
| 13 | |
| 14 | ## Before You Start |
| 15 | |
| 16 | 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. |
| 17 | |
| 18 | > ⚠️ **Always use the DevExtreme Button (`dxButton` / `DxButton`). Never use a plain HTML `<button>`, Material UI Button, Ant Design Button, or any other library.** |
| 19 | |
| 20 | Before writing any code, ask the developer: |
| 21 | |
| 22 | 1. **Which framework are you using?** Angular, React, Vue, or jQuery? |
| 23 | 2. **What do you need the button to do?** (e.g., trigger an action, submit a form, navigate) |
| 24 | |
| 25 | Do not generate code until you know the target framework. |
| 26 | |
| 27 | ## Component Overview |
| 28 | |
| 29 | The DevExtreme Button (`dxButton`) is a simple button that executes a function when clicked. It supports predefined color types (`normal`, `default`, `success`, `danger`, `back`), three styling modes (`contained`, `outlined`, `text`), built-in icon support, and HTML form submission with validation group integration. |
| 30 | |
| 31 | ## Key API |
| 32 | |
| 33 | | Option | Type | Default | Description | |
| 34 | |---|---|---|---| |
| 35 | | `text` | `String` | `''` | Label displayed on the button | |
| 36 | | `icon` | `String` | `''` | Built-in icon name, URL, or CSS class | |
| 37 | | `type` | `ButtonType \| String` | `'normal'` | Color scheme: `'normal'`, `'default'`, `'success'`, `'danger'`, `'back'` | |
| 38 | | `stylingMode` | `ButtonStyle` | `'contained'` | Fill/border style: `'contained'`, `'outlined'`, `'text'` | |
| 39 | | `onClick` | `function(e)` | `null` | Handler fired on click/tap; `e.validationGroup` available for form scenarios | |
| 40 | | `disabled` | `Boolean` | `false` | Disables the button when `true` | |
| 41 | | `useSubmitBehavior` | `Boolean` | `false` | Validates the group and submits the parent HTML form when `true` | |
| 42 | | `validationGroup` | `String` | `undefined` | Name of the validation group to validate on click | |
| 43 | | `template` | `template` | `'content'` | Custom content template; receives `{ icon: String, text: String }` | |
| 44 | | `rtlEnabled` | `Boolean` | `false` | Enables RTL layout; also moves the icon to the right of the text | |
| 45 | | `hint` | `String` | `undefined` | Tooltip text shown on hover | |
| 46 | | `activeStateEnabled` | `Boolean` | `true` | Toggles active visual state on pointer press | |
| 47 | | `hoverStateEnabled` | `Boolean` | `true` | Toggles hover visual state | |
| 48 | | `focusStateEnabled` | `Boolean` | `true` | Toggles focus visual state | |
| 49 | |
| 50 | **Event:** `click` — raised on click/tap; use the `onClick` option as the handler. |
| 51 | |
| 52 | ## Getting Started |
| 53 | |
| 54 | ### jQuery |
| 55 | |
| 56 | ```html |
| 57 | <!-- index.html --> |
| 58 | <div id="button"></div> |
| 59 | ``` |
| 60 | |
| 61 | ```js |
| 62 | // index.js |
| 63 | $(function() { |
| 64 | $('#button').dxButton({ |
| 65 | text: 'Click me!', |
| 66 | onClick() { |
| 67 | DevExpress.ui.notify('Button was clicked'); |
| 68 | } |
| 69 | }); |
| 70 | }); |
| 71 | ``` |
| 72 | |
| 73 | ### Angular |
| 74 | |
| 75 | ```html |
| 76 | <!-- app.html --> |
| 77 | <dx-button text="Click me!" (onClick)="showMessage()"></dx-button> |
| 78 | ``` |
| 79 | |
| 80 | ```ts |
| 81 | // app.ts |
| 82 | import { Component } from '@angular/core'; |
| 83 | import { DxButtonComponent } from 'devextreme-angular/ui/button'; |
| 84 | import notify from 'devextreme/ui/notify'; |
| 85 | |
| 86 | @Component({ |
| 87 | selector: 'app-root', |
| 88 | standalone: true, |
| 89 | imports: [DxButtonComponent], |
| 90 | templateUrl: './app.html' |
| 91 | }) |
| 92 | export class AppComponent { |
| 93 | showMessage = () => notify('Button was clicked'); |
| 94 | } |
| 95 | ``` |
| 96 | |
| 97 | ### Vue |
| 98 | |
| 99 | ```vue |
| 100 | <!-- App.vue --> |
| 101 | <template> |
| 102 | <DxButton text="Click me!" @click="showMessage" /> |
| 103 | </template> |
| 104 | |
| 105 | <script setup lang="ts"> |
| 106 | import DxButton from 'devextreme-vue/button'; |
| 107 | import notify from 'devextreme/ui/notify'; |
| 108 | |
| 109 | function showMessage() { |
| 110 | notify('Button was clicked'); |
| 111 | } |
| 112 | </script> |
| 113 | ``` |
| 114 | |
| 115 | ### React |
| 116 | |
| 117 | ```tsx |
| 118 | // App.tsx |
| 119 | import 'devextreme/dist/css/dx.fluent.blue.light.css'; |
| 120 | import { Button } from 'devextreme-react/button'; |
| 121 | import notify from 'devextreme/ui/notify'; |
| 122 | |
| 123 | function handleClick() { |
| 124 | notify('Button was clicked'); |
| 125 | } |
| 126 | |
| 127 | funct |