Buttons

A base .joy-btn plus two fill variants. Optional <i class="ph ph-*"> icon followed by a <span> for the label.

Variants

HTML
<button class="joy-btn joy-btn-solid"><i class="ph ph-check"></i><span>Solid</span></button>
<button class="joy-btn joy-btn-ghost"><i class="ph ph-arrow-right"></i><span>Ghost</span></button>

Icon-only

Add .joy-btn-icon for a compact circular button — used for the theme toggle and the user menu:

HTML
<button class="joy-btn joy-btn-ghost joy-btn-icon" aria-label="Toggle theme"><i class="ph ph-moon"></i></button>

Text size

Combine with the text utilities (Utilities) for larger CTAs, like the ones in the landing hero:

HTML
<button class="joy-btn joy-btn-solid joy-text-lg"><span>Large button</span> <i class="ph ph-arrow-right"></i></button>

Disabled

HTML
<button class="joy-btn joy-btn-solid" disabled><span>Unavailable</span></button>

Loading state

For buttons that trigger a network call (save, login, submit), use window.JoyButton instead of disabling the button by hand — it swaps the content for a spinner and restores it on its own:

HTML
<button class="joy-btn joy-btn-solid" id="jdocs-btn-demo"><span>Save changes</span></button>
<script>
document.getElementById("jdocs-btn-demo").addEventListener("click", function () {
    var btn = this;
    JoyButton.loading(btn);
    setTimeout(function () { JoyButton.reset(btn); }, 1800);
});
</script>

Full signature at JavaScript API → JoyButton.

Don't use JoyButton on bottom dock items — swapping their content clashes with the dock's own navigation animation.