Page templates
Page templates can help keep the harmony in your app. A template provides existing styling that can be used straight away on a new page. Once the template is in use, you can add, update, or delete components to meet the needs of your application. By using page templates as a starting point for creating new pages, common designs can be mapped out, saving a lot of work when creating new pages.
By default, Mendix comes with several Atlas page templates that can be found in the marketplace modules downloaded into your project. In our video tutorial, we use a dashboard page template to redesign our events dashboard. These page templates come with classes that have been added within the Atlas UI Kit, giving them a custom design that can be copied over to your own application pages. Along with the page templates provided by Atlas, you can create your own custom page templates. This allows you to maintain your design quickly and consistently across new pages.
Widgets and building blocks
Widgets have pre-existing styling to speed up application development. Widgets have design properties that allow you to make UI changes and add custom classes for deeper design customisation. The design properties in widgets allow you to change the styling of elements on your page on an individual basis. Because this affects individual instances of widgets, you will need to change the design properties of widgets on other pages if you want to keep the styling consistent. So, while styling can be applied directly to individual widget instances, it can be difficult to maintain as your application grows.
Building blocks allow you to drag and drop multiple UI elements onto your page. The focus of building blocks is on design rather than functionality, so they should be generalised so that they can be used anywhere in your project or even exported to other applications. Building blocks should be located within UI resource packages and are an efficient way to reuse styling without having to manually change individual widget design properties.
Design mode
As you’re implementing and refining your styling, wouldn’t it be great to see a more simplified view of your app as your end-user might see it? Design mode in Mendix gives you this! By switching to design mode, you can get a visual representation of how the page will look like without having to run your project. Design mode also allows you to modify the design properties of elements on your page and preview the changes in real time. Design mode also allows you to view the page as it would appear on phone, tablet, and desktop, allowing you to verify the responsiveness of your application and ensure that the design is appropriate across devices.
An additional feature from Mendix 10.9 onwards, is that design mode includes the X-ray feature, which allows you to view elements such as data grids and containers on the canvas without having to switch back to structure mode. The X-ray feature keeps the styling on your page, allowing you to quickly modify elements to see any styling changes. This provides a hybrid view where you can see the styling alongside the functional details of the widgets on the page.