BankaiButton

A native <button> with typed variant, size, type, and disabled props. Ships no CSS of its own — the theme styles the bankai-button class and data-bankai-* state.

Example

Props

PropTypeDefaultDescription
variant'solid' | 'outline' | 'ghost' | (string)'solid'Visual variant. A named house variant (solid/outline/ghost) is themed; any other string reflects verbatim as data-bankai-variant as an escape hatch for a custom consumer-styled variant.
size'sm' | 'md' | 'lg' | (string)'md'Size scale. A named step (sm/md/lg) is themed; any other string reflects verbatim as data-bankai-size as an escape hatch for a custom consumer-styled size.
type'submit' | 'reset' | 'button''button'Native button type. Defaults to 'button' rather than the HTML default 'submit', so the button never submits a surrounding form by accident.
disabledbooleanfalseDisable the button via the native disabled attribute.

Emits

This component emits no events.

Slots

SlotDescription
defaultButton content — label and/or icons.

Exposes

This component exposes nothing on its instance.

Theming

Every token is a :root custom property applied through zero-specificity :where() rules, so a single plain declaration overrides one — no selector, no !important. Set it globally on :root or locally on any ancestor.

TokenDefaultPurpose
--bankai-button-fgvar(--bankai-color-primary-fg)Text color of the solid variant.
--bankai-button-bgvar(--bankai-color-primary)Background fill of the solid variant.
--bankai-button-bg-hovercolor-mix(in oklch, var(--bankai-button-bg), black 12%)Solid-variant background on hover.
--bankai-button-bg-activecolor-mix(in oklch, var(--bankai-button-bg), black 20%)Solid-variant background while pressed.
--bankai-button-bg-hover-quietcolor-mix(in oklch, currentcolor 8%, transparent)Hover tint for the quiet (outline/ghost) variants.
--bankai-button-bg-active-quietcolor-mix(in oklch, currentcolor 14%, transparent)Pressed tint for the quiet (outline/ghost) variants.
--bankai-button-border-width1pxBorder width.
--bankai-button-border-stylesolidBorder style.
--bankai-button-border-colortransparentBorder color (the solid variant shows none by default).
--bankai-button-radiusvar(--bankai-radius)Corner radius.
--bankai-button-displayinline-flexBox display mode.
--bankai-button-aligncenterCross-axis alignment of the icon/label row.
--bankai-button-gapvar(--bankai-space-4)Gap between the icon and the label.
--bankai-button-fontinheritFont shorthand (inherits the surrounding text by default).
--bankai-button-cursorpointerCursor over an enabled button.
--bankai-button-transitionbackground-color 150ms ease, border-color 150ms ease, color 150ms easeTransition applied to color changes.
--bankai-button-focus-ringvar(--bankai-focus-ring)Color of the focus-visible outline.
--bankai-button-focus-outline-width2pxWidth of the focus-visible outline.
--bankai-button-focus-outline-offset2pxOffset of the focus-visible outline.
--bankai-button-disabled-opacity0.5Opacity while disabled.
--bankai-button-disabled-cursornot-allowedCursor while disabled.
--bankai-button-sm-padding-yvar(--bankai-space-1)Vertical padding of the small size.
--bankai-button-sm-padding-xvar(--bankai-space-4)Horizontal padding of the small size.
--bankai-button-sm-font-sizevar(--bankai-text-size-sm)Font size of the small size.
--bankai-button-md-padding-yvar(--bankai-space-3)Vertical padding of the medium size.
--bankai-button-md-padding-xvar(--bankai-space-6)Horizontal padding of the medium size.
--bankai-button-md-font-sizevar(--bankai-text-size-md)Font size of the medium size.
--bankai-button-lg-padding-yvar(--bankai-space-4)Vertical padding of the large size.
--bankai-button-lg-padding-xvar(--bankai-space-8)Horizontal padding of the large size.
--bankai-button-lg-font-sizevar(--bankai-text-size-lg)Font size of the large size.