-
AI-powered Extensions
-
Data Grid
-
Tree List
-
Chat
-
HTML Editor
-
Form
-
-
Data Grids / Data Management
-
Data Grid
- Overview
-
Data Binding
-
Filtering
- Sorting
-
Editing
-
Grouping
-
Selection
- Focused Row
- Paging
-
Scrolling
-
Columns
- AI Assistant
-
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
-
Action Sheet
-
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
- Box
- Responsive Box
-
-
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.
React Button - Icons
To add an icon to a Button, set the icon property. This demo shows how you can use this property.
Backend API
import React from 'react';
import { Button } from 'devextreme-react/button';
import notify from 'devextreme/ui/notify';
const weatherClick = () => {
notify('The Weather button was clicked');
};
const doneClick = () => {
notify('The Done button was clicked');
};
const sendClick = () => {
notify('The Send button was clicked');
};
const plusClick = () => {
notify('The button was clicked');
};
const backClick = () => {
notify('The button was clicked');
};
export default function App() {
return (
<div>
<div className="dx-fieldset">
<div className="fields-container">
<div className="dx-field">
<div className="dx-field-label">Built-in icon</div>
<div className="dx-field-value">
<Button icon="check"
type="success"
text="Done"
onClick={doneClick} />
</div>
</div>
<div className="dx-field">
<div className="dx-field-label">Image icon</div>
<div className="dx-field-value">
<Button icon="../../../../images/icons/weather.png"
text="Weather"
onClick={weatherClick} />
</div>
</div>
<div className="dx-field">
<div className="dx-field-label">External icon</div>
<div className="dx-field-value">
<Button className="send"
icon="fa fa-envelope-o"
text="Send"
onClick={sendClick} />
</div>
</div>
<div className="dx-field">
<div className="dx-field-label">Icon only</div>
<div className="dx-field-value">
<Button icon="plus"
onClick={plusClick} />
<Button icon="back"
id="icon-back"
onClick={backClick} />
</div>
</div>
</div>
</div>
<div className="dx-fieldset">
<div className="dx-fieldset-header">DISABLED</div>
<div className="fields-container">
<div className="dx-field">
<div className="dx-field-value">
<Button icon="check"
type="success"
text="Done"
disabled={true} />
</div>
</div>
<div className="dx-field">
<div className="dx-field-value">
<Button icon="../../../../images/icons/weather.png"
text="Weather"
disabled={true} />
</div>
</div>
<div className="dx-field">
<div className="dx-field-value">
<Button className="send"
icon="fa fa-envelope-o"
text="Send"
disabled={true} />
</div>
</div>
<div className="dx-field">
<div className="dx-field-value">
<Button icon="plus"
disabled={true} />
<Button icon="back"
id="icon-disabled-back"
disabled={true} />
</div>
</div>
</div>
</div>
</div>
);
}
import React from 'react';
import { Button } from 'devextreme-react/button';
import notify from 'devextreme/ui/notify';
const weatherClick = () => {
notify('The Weather button was clicked');
};
const doneClick = () => {
notify('The Done button was clicked');
};
const sendClick = () => {
notify('The Send button was clicked');
};
const plusClick = () => {
notify('The button was clicked');
};
const backClick = () => {
notify('The button was clicked');
};
export default function App() {
return (
<div>
<div className="dx-fieldset">
<div className="fields-container">
<div className="dx-field">
<div className="dx-field-label">Built-in icon</div>
<div className="dx-field-value">
<Button
icon="check"
type="success"
text="Done"
onClick={doneClick}
/>
</div>
</div>
<div className="dx-field">
<div className="dx-field-label">Image icon</div>
<div className="dx-field-value">
<Button
icon="../../../../images/icons/weather.png"
text="Weather"
onClick={weatherClick}
/>
</div>
</div>
<div className="dx-field">
<div className="dx-field-label">External icon</div>
<div className="dx-field-value">
<Button
className="send"
icon="fa fa-envelope-o"
text="Send"
onClick={sendClick}
/>
</div>
</div>
<div className="dx-field">
<div className="dx-field-label">Icon only</div>
<div className="dx-field-value">
<Button
icon="plus"
onClick={plusClick}
/>
<Button
icon="back"
id="icon-back"
onClick={backClick}
/>
</div>
</div>
</div>
</div>
<div className="dx-fieldset">
<div className="dx-fieldset-header">DISABLED</div>
<div className="fields-container">
<div className="dx-field">
<div className="dx-field-value">
<Button
icon="check"
type="success"
text="Done"
disabled={true}
/>
</div>
</div>
<div className="dx-field">
<div className="dx-field-value">
<Button
icon="../../../../images/icons/weather.png"
text="Weather"
disabled={true}
/>
</div>
</div>
<div className="dx-field">
<div className="dx-field-value">
<Button
className="send"
icon="fa fa-envelope-o"
text="Send"
disabled={true}
/>
</div>
</div>
<div className="dx-field">
<div className="dx-field-value">
<Button
icon="plus"
disabled={true}
/>
<Button
icon="back"
id="icon-disabled-back"
disabled={true}
/>
</div>
</div>
</div>
</div>
</div>
);
}
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App.tsx';
ReactDOM.render(
<App />,
document.getElementById('app'),
);
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App.js';
ReactDOM.render(<App />, document.getElementById('app'));
<!DOCTYPE html>
<html lang="en">
<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" />
<link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/26.1.5/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" />
<link rel="stylesheet" type="text/css" href="./bundle.css" />
</head>
<body class="dx-viewport">
<div class="demo-container">
<div id="app"></div>
</div>
<script src="bundles/vendor/react.vendor.js"></script>
<script src="./bundle.js"></script>
</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.