Last updated:
This article explains how display variants in Formcentric can be used and individually extended. In addition to using predefined classes, it shows how to define custom variants and integrate them into the desired appearance via CSS or templates.
Many themes support display variants via classes, which can be applied to the markup from the Editor configuration.
Important basic rules:
style_class is intended for additional CSS classesfield_width is an independent property and should be used for width classes
Common examples from the built-in themes:
mwf-s, mwf-m, mwf-l for field widthsmwf-separator for separator variants in supported themesfc-file__dashboard--inline and fc-file__dashboard--modal for file upload display variants
To use your own display variants, you will need three things:
style_class to the matching DOM element (optional)Specify a class in the Editor or in your field configuration, for example:
my-highlightmy-compactfc-file__dashboard--modalStep 1: Create the CSS file
Step 2: Include the CSS file in HTML or build
<link>Step 3: Define CSS rules
Where possible, work against stable theme or wrapper classes and not against arbitrary DOM depths.
Recommendations for more precise adjustments:
In the case of file uploads or more complex fields, always check which element in the template receives the style_class.