Skip to content

Button ​

A light touch, an instant response. Triggers actions and state changes.

Basic usage ​

Live preview
Clicks: 0
View Vue source
Vue · TypeScript
<script setup lang="ts">
import { AgmButton } from 'augma'
import { shallowRef } from 'vue'

const count = shallowRef(0)
</script>

<template>
  <div class="example-row">
    <AgmButton @click="count++">Connect device</AgmButton>
    <AgmButton variant="outline" @click="count++">Secondary action</AgmButton>
    <AgmButton variant="ghost" @click="count++">Subtle action</AgmButton>
    <AgmButton loading>Loading</AgmButton>
    <AgmButton disabled>Unavailable</AgmButton>
    <output aria-live="polite">Clicks: {{ count }}</output>
  </div>
</template>

<style scoped>
.example-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.example-stack {
  display: grid;
  gap: 24px;
  width: 100%;
  max-width: 360px;
}
</style>

API ​

PropTypeDefaultDescription
variant'primary' | 'outline' | 'ghost''primary'Visual emphasis
disabledbooleanfalseBlocks interaction
loadingbooleanfalseShows work in progress and blocks repeated actions
type'button' | 'submit' | 'reset''button'Native button type

Slots ​

  • default: button text

Keyboard and usage notes ​

Tab to focus; Enter or Space to activate. Loading and disabled buttons ignore input.

Installation ​

ts
import { AgmButton } from 'augma'
import 'augma/style.css'

Copy the editable source:

sh
pnpm dlx [email protected] add https://augma.yyj.moe/r/button.json