DevExtreme v23.2 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

Editor Appearance Variants

DevExtreme Editors include the following appearance customization properties.

  • stylingMode: "filled" | "outlined" | "underlined"
    Specifies the style used for text fields.

  • labelMode: "static" | "floating" | "hidden" | "outside"
    Specifies label display mode.

To specify styles globally (as an alternative to stylingMode), set the editorStylingMode property instead (editorStylingMode applies the same style to all editors on the page).

In this demo, you can use the "Styling Mode/Label Mode" drop down box (in the Options section) to modify styling and label modes.

Backend API
$(() => { const stylingMode = 'outlined'; const labelMode = 'static'; DevExpress.config({ editorStylingMode: stylingMode, }); const name = $('#name').dxTextBox({ value: 'Olivia Peyton', placeholder: 'Type...', inputAttr: { 'aria-label': 'Name' }, label: 'Name', labelMode, }).dxValidator({ validationRules: [{ type: 'required', }], }).dxTextBox('instance'); const place = $('#address').dxTextBox({ placeholder: 'Type...', inputAttr: { 'aria-label': 'Address' }, label: 'Address', labelMode, }).dxValidator({ validationRules: [{ type: 'required', }], }).dxTextBox('instance'); const birthDate = $('#birth-date').dxDateBox({ label: 'Birth Date', placeholder: 'Select...', value: '6/3/1981', inputAttr: { 'aria-label': 'Birth Date' }, labelMode, }).dxValidator({ validationRules: [{ type: 'required', }], }).dxDateBox('instance'); const hireDate = $('#hire-date').dxDateBox({ label: 'Hire Date', placeholder: 'Select...', inputAttr: { 'aria-label': 'Hire Date' }, labelMode, }).dxValidator({ validationRules: [{ type: 'required', }], }).dxDateBox('instance'); const range = $('#vacation-dates').dxDateRangeBox({ startDate: '6/3/2023', startDateLabel: 'Start Vacation Date', endDate: '12/3/2023', endDateLabel: 'End Vacation Date', labelMode, }).dxDateRangeBox('instance'); const state = $('#state').dxSelectBox({ items: states, inputAttr: { 'aria-label': 'State' }, placeholder: 'Select...', label: 'State', labelMode, validationMessagePosition: 'left', }).dxValidator({ validationRules: [{ type: 'required', }], }).dxSelectBox('instance'); const phone = $('#phone').dxTextBox({ label: 'Phone', mask: '+1 (000) 000-0000', inputAttr: { 'aria-label': 'Phone' }, maskRules: { X: /[02-9]/, }, labelMode, }).dxValidator({ validationRules: [{ type: 'required', }], }).dxTextBox('instance'); const notes = $('#notes').dxTextArea({ value: 'Olivia loves to sell. She has been selling DevAV products since 2012.', placeholder: 'Type...', label: 'Notes', labelMode, inputAttr: { 'aria-label': 'Notes' }, }).dxTextArea('instance'); $('#validate').dxButton({ text: 'Save', icon: 'save', type: 'default', onClick({ validationGroup }) { const result = validationGroup.validate(); if (result.isValid) { DevExpress.ui.notify('The task was saved successfully.', 'success'); } else { DevExpress.ui.notify('The task was not saved. Please check if all fields are valid.', 'error'); } }, }); const getValueChangedHandler = (optionName) => ({ value }) => { [name, place, birthDate, hireDate, range, state, phone, notes].forEach((editor) => { editor.option(optionName, value); }); }; $('#styling-mode-selector').dxSelectBox({ items: ['outlined', 'filled', 'underlined'], value: 'outlined', label: 'Styling Mode', labelMode: 'outside', inputAttr: { 'aria-label': 'Styling Mode' }, onValueChanged: getValueChangedHandler('stylingMode'), }).dxSelectBox('instance'); $('#label-mode-selector').dxSelectBox({ items: ['static', 'floating', 'hidden', 'outside'], value: 'static', label: 'Label Mode', labelMode: 'outside', inputAttr: { 'aria-label': 'Label Mode' }, onValueChanged: getValueChangedHandler('labelMode'), }).dxSelectBox('instance'); });
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <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=1.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/23.2.5/css/dx.light.css" /> <script src="js/dx.all.js"></script> <link rel="stylesheet" type="text/css" href="styles.css" /> <script src="index.js"></script> <script src="data.js"></script> </head> <body class="dx-viewport"> <div class="demo-container"> <div class="options"> <div class="caption">Options</div> <div class="editors-modes"> <div class="option"> <div id="styling-mode-selector"></div> </div> <div class="option"> <div id="label-mode-selector"></div> </div> </div> </div> <div class="widgets-container"> <div class="title">Edit Profile</div> <div id="name"></div> <div id="address"></div> <div id="birth-date"></div> <div id="state"></div> <div id="phone"></div> <div id="hire-date"></div> <div id="vacation-dates"></div> <div id="notes"></div> </div> <div id="validate"></div> </div> </body> </html>
.demo-container { height: 680px; } .widgets-container { display: grid; grid-template-areas: 'title title title title' 'name name birthDate birthDate ' 'address address state phone' 'hireDate hireDate range range' 'notes notes notes notes'; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 20px; padding-left: 20px; padding-right: 20px; } .title { grid-area: title; font-size: 18px; font-weight: 500; } #name { grid-area: name; } #address { grid-area: address; } #birth-date { grid-area: birthDate; } #state { grid-area: state; } #phone { grid-area: phone; } #hire-date { grid-area: hireDate; } #notes { grid-area: notes; } #vacation-dates { grid-area: range; } #validate { float: right; margin-top: 20px; margin-right: 20px; width: 100px; } .options { grid-area: options; padding: 20px; margin-bottom: 40px; background-color: rgba(191, 191, 191, 0.15); } .caption { font-size: 18px; font-weight: 500; } .editors-modes { display: flex; } .option { padding-right: 20px; margin-top: 20px; }
const states = ['AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'FL', 'GA', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'];