-
Data Grid
- Overview
-
Data Binding
-
Paging and Scrolling
-
Editing
-
Grouping
-
Filtering and Sorting
- Focused Row
-
Row Drag & Drop
-
Selection
-
Columns
- State Persistence
-
Appearance
-
Templates
-
Data Summaries
-
Master-Detail
-
Export to PDF
-
Export to Excel
-
Adaptability
- Keyboard Navigation
-
Pivot Grid
- Overview
-
Data Binding
-
Field Chooser
-
Features
-
Export to Excel
-
Tree List
- Overview
-
Data Binding
- Sorting
- Paging
-
Editing
- Node Drag & Drop
- Focused Row
-
Selection
-
Filtering
-
Column Customization
- State Persistence
- Adaptability
- Keyboard Navigation
-
Scheduler
- Overview
-
Data Binding
-
Views
-
Features
- Virtual Scrolling
-
Grouping
-
Customization
- Adaptability
-
Html Editor
-
Chat
-
Diagram
- Overview
-
Data Binding
-
Featured Shapes
-
Custom Shapes
-
Document Capabilities
-
User Interaction
- UI Customization
- Adaptability
-
Charts
- Overview
-
Data Binding
-
Area Charts
-
Bar Charts
- Bullet Charts
-
Doughnut Charts
-
Financial Charts
-
Line Charts
-
Pie Charts
-
Point Charts
-
Polar and Radar Charts
-
Range Charts
-
Sparkline Charts
-
Tree Map
-
Funnel and Pyramid Charts
- Sankey Chart
-
Combinations
-
More Features
-
Export
-
Selection
-
Tooltips
-
Zooming
-
-
Gantt
- Overview
-
Data
-
UI Customization
- Strip Lines
- Export to PDF
- Sorting
-
Filtering
-
Gauges
- Overview
-
Data Binding
-
Bar Gauge
-
Circular Gauge
-
Linear Gauge
-
Navigation
- Overview
- Accordion
-
Menu
- Multi View
-
Drawer
-
Tab Panel
-
Tabs
-
Toolbar
- Pagination
-
Tree View
- Right-to-Left Support
-
Layout
-
Editors
- Overview
- Autocomplete
-
Calendar
- Check Box
- Color Box
-
Date Box
-
Date Range Box
-
Drop Down Box
-
Number Box
-
Select Box
- Switch
-
Tag Box
- Text Area
- Text Box
- Validation
- Custom Text Editor Buttons
- Right-to-Left Support
- Editor Appearance Variants
-
Forms and Multi-Purpose
- Overview
- Button Group
- Field Set
-
Filter Builder
-
Form
- Radio Group
-
Range Selector
- Numeric Scale (Lightweight)
- Numeric Scale
- Date-Time Scale (Lightweight)
- Date-Time Scale
- Logarithmic Scale
- Discrete scale
- Custom Formatting
- Use Range Selection for Calculation
- Use Range Selection for Filtering
- Image on Background
- Chart on Background
- Customized Chart on Background
- Chart on Background with Series Template
- Range Slider
- Slider
-
Sortable
-
File Management
-
File Manager
- Overview
-
File System Types
-
Customization
-
File Uploader
-
-
Actions and Lists
- Overview
-
Action Sheet
-
Button
- Floating Action Button
- Drop Down Button
-
Context Menu
-
List
-
Lookup
-
Maps
- Overview
-
Map
-
Vector Map
-
Dialogs and Notifications
-
Localization
Related Demos:
Your search did not match any results.
JavaScript/jQuery Button - Icons
To add an icon to a JavaScript Button, set the icon property. This demo shows how you can use this property.
Was this demo helpful?
Feel free to share demo-related thoughts here.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Thank you for the feedback!
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Backend API
$(() => {
$('#icon-done').dxButton({
icon: 'check',
type: 'success',
text: 'Done',
onClick() {
DevExpress.ui.notify('The Done button was clicked');
},
});
$('#icon-weather').dxButton({
icon: '../../../../images/icons/weather.png',
text: 'Weather',
onClick() {
DevExpress.ui.notify('The Weather button was clicked');
},
});
$('#icon-send').dxButton({
icon: 'fa fa-envelope-o',
text: 'Send',
onClick() {
DevExpress.ui.notify('The Send button was clicked');
},
});
$('#icon-plus').dxButton({
icon: 'plus',
onClick() {
DevExpress.ui.notify('The button was clicked');
},
});
$('#icon-back').dxButton({
icon: 'back',
onClick() {
DevExpress.ui.notify('The button was clicked');
},
});
$('#icon-disabled-done').dxButton({
icon: 'check',
type: 'success',
text: 'Done',
disabled: true,
});
$('#icon-disabled-weather').dxButton({
icon: '../../../../images/icons/weather.png',
text: 'Weather',
disabled: true,
});
$('#icon-disabled-send').dxButton({
icon: 'fa fa-envelope-o',
text: 'Send',
disabled: true,
});
$('#icon-disabled-plus').dxButton({
icon: 'plus',
disabled: true,
});
$('#icon-disabled-back').dxButton({
icon: 'back',
disabled: true,
});
});
<!DOCTYPE html>
<html>
<head>
<title>DevExtreme Demo</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>window.jQuery || document.write(decodeURIComponent('%3Cscript src="js/jquery.min.js"%3E%3C/script%3E'))</script>
<link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/24.2.3/css/dx.light.css" />
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" />
<script src="js/dx.all.js"></script>
<link rel="stylesheet" type="text/css" href="styles.css" />
<script src="index.js"></script>
</head>
<body class="dx-viewport">
<div class="demo-container">
<div class="dx-fieldset">
<div class="fields-container">
<div class="dx-field">
<div class="dx-field-label">Built-in icon</div>
<div class="dx-field-value">
<div id="icon-done"></div>
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">Image icon</div>
<div class="dx-field-value">
<div id="icon-weather"></div>
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">External icon</div>
<div class="dx-field-value">
<div id="icon-send" class="send"></div>
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">Icon only</div>
<div class="dx-field-value">
<div id="icon-plus"></div>
<div id="icon-back"></div>
</div>
</div>
</div>
</div>
<div class="dx-fieldset">
<div class="dx-fieldset-header">DISABLED</div>
<div class="fields-container">
<div class="dx-field">
<div class="dx-field-value">
<div id="icon-disabled-done"></div>
</div>
</div>
<div class="dx-field">
<div class="dx-field-value">
<div id="icon-disabled-weather"></div>
</div>
</div>
<div class="dx-field">
<div class="dx-field-value">
<div id="icon-disabled-send" class="send"></div>
</div>
</div>
<div class="dx-field">
<div class="dx-field-value">
<div id="icon-disabled-plus"></div>
<div id="icon-disabled-back"></div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
#icon-back,
#icon-disabled-back {
margin-left: 4px;
}
.dx-viewport .dx-fieldset {
width: 520px;
margin: 30px auto;
}
.dx-viewport .dx-fieldset:first-child {
margin-top: 120px;
}
.dx-viewport .dx-fieldset-header {
font-size: 16px;
}
.dx-viewport .dx-field {
display: inline-block;
margin-right: 20px;
}
.dx-viewport .dx-field-value:not(.dx-widget) > .dx-button {
float: none;
}
.dx-viewport .dx-field-value:not(.dx-switch):not(.dx-checkbox):not(.dx-button),
.dx-viewport .dx-field-label {
float: none;
width: 100%;
}
.dx-viewport .dx-field-label {
padding-left: 0;
}
.send .dx-button-content .dx-icon {
font-size: 18px;
}
.fields-container {
display: flex;
align-items: baseline;
}
.dx-field-value {
display: flex;
}
-
Built-in icons
DevExtreme ships with its own icon library. Pick any icon and assign its name to the icon property. -
Image file
Set the icon value to the image file path or URI. -
3rd-party icon fonts
You can import a 3rd-party font library (this example uses Font Awesome). In such cases, set the icon property to a name that identifies the required glyph. Look up names in the imported library's documentation. -
Buttons with icons and no caption text
Define the icon, but do not define the text property. You can use the hint property to annotate the button.
Refer to the Icons help topic for additional information.