Skip to content

Btn

Button element to handle click events

Basic Usage

vue
<script setup>
import { Btn } from '@8ctavio/vergil/components'
</script>

<template>
    <Btn>Keep it Clean!</Btn>
</template>

Props

Label
label: string
MiniMarkup

Simple Btn text content can be specified through the default slot or the label prop. The slot content overrides the label prop.

vue
<Btn label="Click"/>

Variant
variant: ('solid' | 'soft' | 'subtle') = 'solid'

Mask
mask: ('ghost' | 'form-field')

Outline
outline: (boolean | 'subtle' | 'regular' | 'strong')

The 'regular' and true values are equivalent. For the solid variant, only buttons with mask are affected.

Fill
fill: boolean
only for masked buttons

Underline
underline: boolean
only for masked buttons

Icon
icon: string
alias:
icon-left

vue
<Btn icon="rocket_launch"/>

Icon Right
icon-right: string

vue
<Btn label="Omega" icon-right="special_character"/>

Squared
squared: boolean

Adding squared sets padding to the same value on all sides.

Theme
theme: theme = 'brand'

Size
size: ('xs' | 'sm' | 'md' | 'lg' | 'xl') = 'md'

Radius
radius: ('none' | 'sm' | 'md' | 'lg' | 'full') = 'md'

Spacing
spacing: ('compact' | 'expanded') = ''

Disabled
disabled: boolean

Loading
loading: boolean

API Reference

Props

proptypedefault
labelstring
variant'solid' | 'soft' | 'subtle''solid'
mask'ghost' | 'form-field'
outlineboolean | 'subtle' | 'regular' | 'strong'
underlineboolean
fillboolean
iconstring
iconLeftstring
iconRightstring
squaredbooleanfalse
disabledbooleanfalse
loadingbooleanfalse
descendantboolean
theme'brand' | 'user' | 'ok' | 'info' | 'warn' | 'danger' | 'neutral''brand'
size'xs' | 'sm' | 'md' | 'lg' | 'xl''md'
radius'none' | 'sm' | 'md' | 'lg' | 'full''md'
spacing'' | 'compact' | 'extended'''

Configuration options

Btn's configuration options allow to overwrite some Btn props' default values and may be overwritten under the btn root-level configuration option.

btn.<option>typedefaultglobal
variant'solid' | 'soft' | 'subtle''solid'
<variant>.mask'ghost' | 'form-field'
<variant>.outlineboolean | 'subtle' | 'regular' | 'strong'
<variant>.underlineboolean
<variant>.fillboolean
squaredboolean
themetheme
sizesize
radiusradius
spacingspacing

Anatomy

<button.btn/>

<span.btn-backdrop/>

<div.btn-content/>

<Icon.icon/>

<slot name="default"/>

<Icon.icon/>

<div.btn-loader/>

<span.btn-spinner/>

<slot name="aside"/>