Skip to content

Shadleaf

Shadleaf is a library of UI components for Thymeleaf, as a Spring Boot starter. Add one dependency, include two fragments in your layout’s <head>, and write <sl:button>:

Variants
Thymeleaf source
<sl:button>Default</sl:button>
<sl:button variant="outline">Outline</sl:button>
<sl:button variant="ghost">Ghost</sl:button>
<sl:button variant="destructive">Destructive</sl:button>
<sl:button variant="secondary">Secondary</sl:button>
<sl:button variant="link">Link</sl:button>
Rendered HTML
<button class="button" type="button">Default</button>
<button class="button" type="button" data-variant="outline">Outline</button>
<button class="button" type="button" data-variant="ghost">Ghost</button>
<button class="button" type="button" data-variant="destructive">Destructive</button>
<button class="button" type="button" data-variant="secondary">Secondary</button>
<button class="button" type="button" data-variant="link">Link</button>
  • Fits your build. The jar ships compiled CSS, served under /shadleaf/**, so a plain Maven build is enough. Already compiling Tailwind? The embedded bundle fits into your own build.
  • Themed with CSS variables. --primary, --radius, --ring: redefine them and every component follows, see token overrides.
  • Declared props. A typo such as variant="destructve" fails with the legal values, and an icon-only button without an aria-label fails too, instead of shipping.
  • Adjustable in five steps, from a prop to owning the template yourself: see the adjustability ladder.
  • Works under a strict Content-Security-Policy, with no 'unsafe-inline': see CSP.

Every preview on this site is rendered by the library itself, from the build that produced these pages, so it shows exactly the markup your application gets.