Skip to content

Button

Demo

Button Cross-platform Example and Preview

Hierarchy

Semantic tones

Sizes

States

Shape and layout

Basic Usage

vue
<template>
  <VButton>Default</VButton>
  <VButton tone="primary">
    Primary
  </VButton>
  <VButton tone="success">
    Success
  </VButton>
  <VButton tone="warning">
    Warning
  </VButton>
  <VButton tone="danger">
    Danger
  </VButton>
</template>

Variants

vue
<template>
  <VButton variant="solid">
    Solid
  </VButton>
  <VButton variant="outline">
    Outline
  </VButton>
  <VButton variant="ghost">
    Ghost
  </VButton>
  <VButton plain>
    Plain
  </VButton>
  <VButton hairline plain>
    Hairline
  </VButton>
</template>

Sizes

vue
<template>
  <VButton size="sm">
    Small
  </VButton>
  <VButton size="md">
    Medium
  </VButton>
  <VButton size="lg">
    Large
  </VButton>
</template>

Shape And Block

vue
<template>
  <VButton shape="square">
    Square
  </VButton>
  <VButton shape="round">
    Round
  </VButton>
  <VButton block>
    Block
  </VButton>
</template>

Icon And Loading

vue
<template>
  <VButton icon="+">
    Create
  </VButton>
  <VButton icon="✓" icon-position="right">
    Done
  </VButton>
  <VButton loading>
    Submitting
  </VButton>
  <VButton loading loading-text="Saving..." />
</template>

Color And Native Type

vue
<template>
  <VButton color="#07c160">
    Custom Color
  </VButton>
  <VButton native-type="submit">
    Submit Form
  </VButton>
  <VButton disabled>
    Disabled
  </VButton>
</template>

Props

PropTypeDefaultDescription
variant'solid' | 'outline' | 'ghost''solid'Visual variant
tone'default' | 'primary' | 'success' | 'warning' | 'danger''primary'Semantic tone
size'sm' | 'md' | 'lg''md'Button size
shape'default' | 'square' | 'round''default'Button shape
plainbooleanfalsePlain button, mapped to outline styling
hairlinebooleanfalseHairline border marker
blockbooleanfalseFill the parent width
iconstringundefinedIcon text or icon name for the style layer
iconPosition'left' | 'right''left'Icon position
loadingbooleanfalseLoading state, blocks clicks
loadingTextstringundefinedReplaces default content while loading
disabledbooleanfalseDisabled state
colorstringundefinedCustom button color
nativeType'button' | 'submit' | 'reset'undefinedNative button type

Slots

SlotDescription
defaultButton content
iconCustom icon content; has priority over the icon prop

Data Attributes

AttributeDescription
data-variantCurrent visual variant
data-toneCurrent semantic tone
data-sizeCurrent size
data-shapeCurrent shape
data-loadingLoading state
data-disabledDisabled state
data-plainPlain state
data-hairlineHairline state
data-blockBlock state