1. Components
  2. theme
  3. buttons

Button Variants

Button styling system — variants, intents, and customization

JK-UI buttons use a dual variant+intent system. Base visual recipes live in button.css, while every available variant+intent combination is grouped in intents.css.

How It Works

The base btn-solid, btn-outline, btn-soft, and btn-ghost utilities consume CSS variables. Combined utilities only provide those variables:
/* intents.css */
@utility btn-solid-primary {
  --btn-color: var(--color-primary);
  --btn-fg: var(--color-primary-foreground);
}

Variants

VariantDescription
solidFilled background with layered shadow
outlineBorder with subtle background
softLight tinted background
ghostTransparent, visible on hover

Solid

Outline

Soft

Ghost

Intents by Variant

VariantAvailable Intents
solidprimary, secondary, accent, neutral, destructive
softprimary, destructive, warning, gray
outlinegray
ghostgray

Sizes

SizeHeightPaddingFont
xs1.5rem0.875remxs
sm2rem1remsm
md2.5rem1.25remsm
lg2.5rem1.25remsm
xl2.75rem1.5rembase

Customization

Override button colors at any level:

Component-level

<Button className="[--btn-solid-bg:var(--color-purple-600)]">
  Custom
</Button>

New intent

Add new intent values to the tv() config in your local button.tsx:
solid: {
  purple: "[--btn-solid-top-shadow:var(--color-purple-500)] [--btn-solid-bottom-shadow:var(--color-purple-700)] ...",
}