Skip to content

KButton

示例

Variants

Sizes

States

Native Button Types

Try each button type

Button component with variant, size, disabled, and loading states.

Props

NameTypeDefaultDescription
variant'default' | 'outline' | 'secondary' | 'ghost' | 'destructive' | 'link''default'Visual style variant of the button.
size'xs' | 'sm' | 'default' | 'lg' | 'icon' | 'icon-xs' | 'icon-sm' | 'icon-lg''default'Size of the button. Use icon* sizes for icon-only buttons.
disabledbooleanfalseWhether the button is disabled.
loadingbooleanfalseWhether the button is in a loading state. Shows a spinner and disables interaction.
type'button' | 'submit' | 'reset''button'Native HTML button type attribute.
theme'auto' | 'day' | 'night''auto'Theme mode. auto follows the current theme; day and night force a specific mode.

Emits

NameParametersDescription
click(event: MouseEvent)Emitted when the button is clicked (not emitted when disabled or loading).

Slots

NameDescription
defaultButton label or content.

Basic Usage

vue
<script setup>
import { KButton } from '@kK-2004/ui-component'
</script>

<template>
  <KButton variant="default" size="default">
    Click me
  </KButton>
</template>