> For the complete documentation index, see [llms.txt](https://admincode.gitbook.io/admincode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://admincode.gitbook.io/admincode/basics/theming-and-styling.md).

# Theming and Styling

Using [**Thymeleaf**](https://www.thymeleaf.org/) with **Spring MVC** provides a powerful and flexible templating engine that integrates seamlessly with Spring’s MVC framework. Thymeleaf allows you to create dynamic, reusable, and well-structured HTML templates, making it easy to maintain and extend your application's UI. One of its key advantages is that it enables natural HTML templating, meaning you can design and preview templates in a browser without requiring a running server. By leveraging [**Bootstrap**](https://getbootstrap.com/) templates, you can quickly apply consistent styling across your application, and changing the look and feel becomes effortless—simply update the template files or CSS styles without modifying backend logic. This makes UI customization highly efficient, keeping development agile and scalable.

Admin Code has 2 layouts available to choose

**Default**

<figure><img src="https://2308997185-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8FIBMz5maCg8JQVrVt15%2Fuploads%2FIZ10EJjLoQYhUunueIS3%2FScreenshot%202025-03-02%20at%202.45.14%E2%80%AFPM.png?alt=media&amp;token=a2d3bd88-8bfc-4de3-acb8-ec95dfe608f9" alt=""><figcaption></figcaption></figure>

**Advanced**

<figure><img src="https://2308997185-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8FIBMz5maCg8JQVrVt15%2Fuploads%2FwrCqEgwYTXTG1Mv68IPS%2FScreenshot%202025-03-02%20at%202.41.32%E2%80%AFPM.png?alt=media&amp;token=f02c7e37-deff-4f7b-8402-b76c96a26fac" alt=""><figcaption></figcaption></figure>

To switch between the two layouts dynamically, you can use a **Spring configuration property**. This way, updating the look and feel of your admin app is just a matter of changing a single setting rather than refactoring multiple pages.&#x20;

**application.properties**

```
#could be main or advanced
app.theme=advanced
```

## Adding a new Bootstrap theme

Create a new folder under views folder

Add ***index.html, dashboard.html, login.html and signup.html*** extending ***main/masterlayout.html***

```
<html 
   lang="en" 
   xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
   layout:decorate="~{main/masterlayout.html}">
```

* WebContent
  * WEB-INF
    * vews

      * **new-theme**
        * **index.html**
        * **dashboard.html**
        * **login.html**
        * **signup.html**

In application.properties set value to ***app.theme=new-theme***
