Skip to content
navy

Button

Versatile button component with loading states, icons, and multiple variants.

Live Demo

With Icons

States

Usage

Basic

vue
<template>
  <orio-button @click="handleClick">
    Click Me
  </orio-button>
</template>

<script setup>
function handleClick() {
  console.log('Clicked!')
}
</script>

Button Variants

vue
<orio-button variant="primary">Primary</orio-button>
<orio-button variant="secondary">Secondary</orio-button>
<orio-button variant="subdued">Subdued</orio-button>

With Icons

vue
<!-- Icon before text -->
<orio-button icon="edit">Edit</orio-button>

<!-- Icon only (automatically rounds to circle) -->
<orio-button icon="plus" />

Loading State

vue
<template>
  <orio-button :loading="isLoading" @click="save">
    Save Changes
  </orio-button>
</template>

<script setup>
const isLoading = ref(false)

async function save() {
  isLoading.value = true
  await api.save()
  isLoading.value = false
}
</script>

Props

PropTypeDefaultDescription
variant'primary' | 'secondary' | 'subdued''primary'Button visual style
iconstringundefinedIcon name from icon registry
loadingbooleanfalseShows loading spinner, prevents clicks
disabledbooleanfalseDisables button interaction

Note: The native HTML type attribute (e.g., type="submit") can be used normally via v-bind and will be passed through to the underlying <button> element.

Events

EventPayloadDescription
clickPointerEventEmitted on button click (when not loading/disabled)

Slots

SlotPropsDescription
default-Button text content
icon-Custom icon content

Styling

The button uses these CSS variables:

css
--color-accent       /* Primary button background */
--color-accent-ink   /* Text color on primary */
--color-accent-hover /* Hover state */
--color-accent-border