-
Data Grids / Data Management
-
Data Grid
- Overview
-
Data Binding
-
Filtering
- Sorting
-
Editing
-
Grouping
-
Selection
- Focused Row
- Paging
-
Scrolling
-
Columns
-
Master-Detail
-
Data Summaries
-
Drag & Drop
-
Export to PDF
-
Export to Excel
- Appearance
-
Customization
- State Persistence
-
Adaptability
-
Keyboard Navigation
- Right-To-Left Support
-
Tree List
- Overview
-
Data Binding
-
Filtering
- Sorting
-
Editing
-
Selection
- Focused Row
- Paging
-
Columns
- Drag & Drop
- State Persistence
- Adaptability
-
Keyboard Navigation
-
Card View
-
Pivot Grid
- Overview
-
Data Binding
-
Field Management
-
Data Summaries
- Drill Down
- Filtering
-
Scrolling
-
Export to Excel
- Chart Integration
- Customization
- State Persistence
-
Filter Builder
-
-
Data Visualization
-
Charts
- Overview
-
Data Binding
-
Common Concepts
-
Axis
-
Aggregation
-
Tooltips
-
Selection
-
Customization
-
Zooming
-
Export
-
-
Area Charts
-
Bar Charts
- Bullet Charts
-
Doughnut Charts
-
Financial Charts
-
Funnel and Pyramid Charts
-
Line Charts
- Pareto Chart
-
Pie Charts
-
Point Charts
-
Polar and Radar Charts
-
Range Charts
- Sankey Chart
-
Sparkline Charts
-
Tree Map
-
Gauges
- Overview
-
Runtime update
-
Bar Gauge
-
Circular Gauge
-
Linear Gauge
-
Diagram
- Overview
-
Data Binding
-
Featured Shapes
-
Custom Shapes
-
Document Capabilities
-
User Interaction
- UI Customization
- Adaptability
-
-
Scheduling / Planning
-
Scheduler
- Overview
-
Data Binding
-
Views
-
Appointments
-
Timetable
- Editing
-
Grouping
- Virtual Scrolling
- Drag & Drop
-
Customization
- Adaptability
-
Gantt
- Overview
- Data Binding
-
Filtering
- Sorting
- Strip Lines
- Export to PDF
- Validation
-
Customization
-
-
Messaging
-
WYSIWYG Editor
-
Forms
-
Data Editors
- Overview
-
Common Concepts
-
Calendar
- Check Box
- Color Box
- Date Box
-
Date Range Box
-
Number Box
- Radio Group
-
Range Selector
- Range Slider
- Slider
- Switch
- Text Area
- Text Box
-
Drop-Downs
- Autocomplete
-
Drop Down Box
-
Select Box
-
Tag Box
-
Lookup
-
Buttons
-
File Upload / File Management
-
File Manager
- Overview
-
File System Types
-
Customization
-
File Uploader
-
-
Popup and Notifications
-
Navigation
- Overview
- Accordion
-
Context Menu
-
Menu
- Multi View
-
Drawer
-
Tab Panel
-
Tabs
-
Toolbar
-
Stepper
- Pagination
-
List
-
Tree View
- Right-to-Left Support
-
Layout
-
Tile View
- Splitter
-
Gallery
- Scroll View
-
-
Interactive Wrappers
-
Sortable
- Resizable
-
-
Progress Indicators
-
Maps
- Overview
-
Map
-
Vector Map
-
Data Binding
- Multiple Layers
-
Markers
- Legend
-
Zooming and Panning
-
Customization
-
-
Localization
Related Demos:
Your search did not match any results.
Button - Icons
To add an icon to a 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
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" />
<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">
@(Html.DevExtreme().Button()
.Icon("check")
.Text("Done")
.Type(ButtonType.Success)
.OnClick("notify")
)
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">Image icon</div>
<div class="dx-field-value">
@(Html.DevExtreme().Button()
.Icon(Url.Content("~/Content/Images/button/weather.png"))
.Text("Weather")
.OnClick("notify")
)
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">External icon</div>
<div class="dx-field-value">
@(Html.DevExtreme().Button()
.Icon("fa fa-envelope-o")
.Text("Send")
.ElementAttr("class", "send")
.OnClick("notify")
)
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">Icon only</div>
<div class="dx-field-value">
@(Html.DevExtreme().Button()
.Icon("plus")
.OnClick("notify")
)
@(Html.DevExtreme().Button()
.ID("icon-back")
.Icon("back")
.OnClick("notify")
)
</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">
@(Html.DevExtreme().Button()
.Icon("check")
.Text("Done")
.Type(ButtonType.Success)
.Disabled(true)
)
</div>
</div>
<div class="dx-field">
<div class="dx-field-value">
@(Html.DevExtreme().Button()
.Icon(Url.Content("~/Content/Images/button/weather.png"))
.Text("Weather")
.Disabled(true)
)
</div>
</div>
<div class="dx-field">
<div class="dx-field-value">
@(Html.DevExtreme().Button()
.Icon("fa fa-envelope-o")
.Text("Send")
.ElementAttr("class", "send")
.Disabled(true)
)
</div>
</div>
<div class="dx-field">
<div class="dx-field-value">
@(Html.DevExtreme().Button()
.Icon("plus")
.Disabled(true)
)
@(Html.DevExtreme().Button()
.ID("icon-disabled-back")
.Icon("back")
.Disabled(true)
)
</div>
</div>
</div>
</div>
<script>
function notify(data) {
var buttonText = data.component.option("text");
DevExpress.ui.notify("The " + buttonText + " button was clicked");
}
</script>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
namespace DevExtreme.MVC.Demos.Controllers {
public class ButtonController : Controller {
public ActionResult Icons() {
return View();
}
}
}
#icon-back, #icon-disabled-back {
margin-left: 4px;
}
.dx-viewport .dx-fieldset {
width: 520px;
margin: 30px auto;
}
.dx-viewport .dx-fieldset:first-of-type {
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.