docs/components/input/Button

Button

Polymorphic button with size and variant props.

import { Button } from '@ybouhjira/hyperkit';

#Playground

Edit the code — the preview recompiles and re-renders as you type.

Live playground
Loading preview…

#More Examples

Secondary

<Button variant="secondary">Secondary</Button>

Ghost

<Button variant="ghost">Ghost</Button>

#Props

PropTypeDefaultDescription
variant'primary' | 'secondary' | 'ghost' | 'danger' | 'outline' | 'link''primary'Visual style variant. Affects background, border, and text color.
size'sm' | 'md' | 'lg''md'Size variant. Controls padding and font size.
loadingbooleanfalseShow loading spinner and disable interaction.
disabledbooleanfalseDisable button interaction.
fullWidthbooleanfalseExpand button to full width of container.
roundedbooleanfalseApply pill shape with fully rounded corners (border-radius: 9999px).
asstringKobalteButtonHTML element to render as (e.g., 'a', 'button').
unstyledbooleanfalseRemove all default styles, only apply classNames.
classNames{ /** Class for root button element. */ root?: string; /** Class for loading spinner element. */ spinner?: string; }Custom class names for sub-elements.
classstringAdditional CSS class for root element.
styleJSX.CSSPropertiesInline styles for root element.
children *JSX.ElementButton content.
onClick(e: MouseEvent) => voidClick event handler.
type'button' | 'submit' | 'reset''button'Button type attribute.
tooltipstringTooltip content. When provided, the button is wrapped in a Tooltip primitive with this content. When omitted, the button renders without any tooltip wrapper.

* required prop.

#Design Tokens

This component reads the following CSS custom properties. Override them globally or per-instance to restyle it — see the CSS Variables guide.

  • --sk-accent
  • --sk-accent-hover
  • --sk-bg-secondary
  • --sk-bg-tertiary
  • --sk-border
  • --sk-btn-danger-bg
  • --sk-btn-danger-color
  • --sk-btn-disabled-opacity
  • --sk-btn-font-weight
  • --sk-btn-ghost-bg
  • --sk-btn-ghost-color
  • --sk-btn-ghost-hover-bg
  • --sk-btn-lg-font-size
  • --sk-btn-lg-padding-x
  • --sk-btn-lg-padding-y
  • --sk-btn-line-height
  • --sk-btn-link-bg
  • --sk-btn-link-color
  • --sk-btn-md-font-size
  • --sk-btn-md-padding-x
  • --sk-btn-md-padding-y
  • --sk-btn-outline-bg
  • --sk-btn-outline-border-color
  • --sk-btn-outline-color
  • --sk-btn-outline-hover-bg
  • --sk-btn-outline-hover-border-color
  • --sk-btn-primary-bg
  • --sk-btn-primary-color
  • --sk-btn-primary-hover-bg
  • --sk-btn-radius
  • --sk-btn-secondary-bg
  • --sk-btn-secondary-color
  • --sk-btn-secondary-hover-bg
  • --sk-btn-sm-font-size
  • --sk-btn-sm-padding-x
  • --sk-btn-sm-padding-y
  • --sk-duration-fast
  • --sk-duration-spin
  • --sk-error
  • --sk-font-size-base
  • --sk-font-size-lg
  • --sk-icon-md
  • --sk-radius-md
  • --sk-space-lg
  • --sk-space-md
  • --sk-space-sm
  • --sk-space-xs
  • --sk-text-on-accent
  • --sk-text-primary
  • --sk-text-secondary