The adjustability ladder
Each step is more powerful, and more work to maintain, than the one before it. Take the first one that solves your problem.
1. Props
Section titled “1. Props”<sl:button variant="outline" size="sm">Cancel</sl:button>The declared props of each component are listed on its page. This covers most needs, with no CSS at all.
2. Pass-through attributes and classes
Section titled “2. Pass-through attributes and classes”Every attribute that is not a prop lands on the rendered element: hx-post, x-on:click, aria-*, data-*.
class is appended to the component’s own class.
<sl:button class="toolbar-action" hx-post="/orders/42/archive">Archive</sl:button>The classes are your application’s own. If you compile Tailwind, class="w-full mt-4" works; if you don’t, use a class
from your own stylesheet. The library’s bundles define no utility classes.
3. Token overrides
Section titled “3. Token overrides”The components are drawn with CSS variables. Redefine them in your stylesheet, loaded after the library’s, to rebrand every component at once:
:root { --primary: oklch(0.55 0.15 150); --primary-foreground: oklch(0.98 0 0); --radius: 0.25rem;}.dark { --primary: oklch(0.7 0.14 150);}The library’s tokens sit in a cascade layer, so your values win whether or not you put them in a layer yourself.
The variables have shadcn/ui’s names, so a theme from a shadcn theme builder, such as tweakcn or shadcn’s own, can be pasted in unchanged.
4. Skin
Section titled “4. Skin”shadleaf.skin=lyraA skin changes geometry, spacing, type size and shadow: the same markup and the same tokens, a different look. There are nine:
| Skin | Look |
|---|---|
vega |
The default: the classic look, clean and neutral. |
lyra |
Boxy and sharp: square corners, small type and a thin focus ring. |
nova |
Reduced padding and margins: vega one size smaller, with a muted footer. |
maia |
Rounded, with generous spacing: pill-shaped buttons and fields. |
mira |
Made for compact interfaces: small type and 28px controls. |
luma |
Fluid, luminous and soft: maia’s shapes, borderless fields, soft shadows. |
rhea |
Like luma, but compact: smaller controls, tighter menus and tables. |
sera |
Editorial and typographic: square, uppercase labels, underlined fields. |
The ninth, sketch, makes the components look hand-drawn, as a wireframe in Balsamiq does, for mockups and
prototypes that should not pass for the finished application. Pencil lines with uneven corners, wavy underlines, hatched
skeletons and a handwritten font, Balsamiq Sans, which ships with the skin (SIL Open Font License). It sets that font on
the page’s body, so your headings and text are handwritten too; a font of your own on the body wins. The colours still
come from the tokens: a theme applies, and the pencil is --foreground.
Token overrides keep working under every skin. Use the skin switch on any preview in these docs to compare.
5. Own the template
Section titled “5. Own the template”Copy a component’s template from the jar, for example templates/sl/components/button.html, into your application’s
src/main/resources/templates/sl/components/. Your copy wins, props included, with no configuration.
Your copy no longer receives the library’s fixes, so compare it with the new version when you upgrade. A test that renders a page using the component keeps it honest.
You can add components of your own the same way: a template at templates/sl/components/badge.html is <sl:badge>.