Button
Button with four variants (solid, soft, outline, ghost), eight semantic colors, icon slots, loading, and block layout.
import { Button } from "@plexui/vue/components/Button";Examples
Overview
Colors & variants
Sizing & roundness
Icons
Block
States
Use disabled to visually and accessibly disable the button. Loading shows a spinner and prevents interaction through its default inert state. The controls demonstrate these props; they do not start an asynchronous action. Every variant takes both states. On a phone the buttons are a screen's actions, the large ones as wide as the screen. A disabled button there labels in the tertiary label of iOS on the gray of a gray button, as iOS 27.2 draws a disabled filled or gray button; a ghost one has no fill, an outline one keeps its border with no fill, and a glass one keeps the glass. inert blocks a button without any visual change: it applies disabled for accessibility, and the look of a disabled button comes only from [data-disabled].
Selected
Optical alignment
Sign in with your email or phone number to continue.
Button shares the unified 9-step size scale with Input, Select, SelectControl, and SegmentedControl.
NavigationButton
NavigationButton supplies a Back, Close, or Confirm glyph inside the public Button. The caller owns navigation, dismissal, and form submission. Page toolbars and Dialog header actions retain its role-specific glyph sizing and 44px Phone target.
import { NavigationButton } from '@plexui/vue/components/Button';
<NavigationButton action="back" aria-label="Back to albums" @click="goBack" />
<NavigationButton action="close" @click="cancel" />
<NavigationButton action="confirm" type="submit" form="album" aria-label="Save album" />action is required: "back" | "close" | "confirm". Accessible names default to Back, Close, and Confirm; override aria-label for the destination or operation. Other Button and native button props remain available, including type, form, disabled/loading state, event handlers, and refs. The component owns its glyph, pill, and uniform shape, so it does not accept children or an icon-size override.
Back and Close default to secondary soft buttons with the mobile glass material. Confirm defaults to primary solid; an explicit color or variant still overrides it. Use the existing shared application accent recipe to set the primary palette once in application CSS after the stylesheet imports. Semantic info remains available for informational states.
Phone geometry uses --navigation-button-size, --navigation-button-back-icon-size, --navigation-button-close-icon-size, and --navigation-button-confirm-icon-size. Desktop retains Button sizing. Unrelated toolbar buttons keep their existing icon sizes.
API
For neutral soft or ghost buttons, mobileMaterial="glass" applies the mobile toolbar surface below 768px with touch.css. Its label is the Liquid Glass text button's of the iOS 27 kit: Medium, 17px from md up (--button-glass-font-weight, --button-glass-font-size). Page toolbar icon buttons use it automatically. Use mobileMaterial="flat" to keep the original variant in a toolbar. Desktop appearance is unchanged.
Props mirror the React Button. In Vue, pass classes with class (React's className) and listen with @click.
| Prop | Type | Default | Description |
|---|---|---|---|
color | "primary" | "secondary" | "danger" | "success" | "info" | "discovery" | "caution" | "warning" | "primary" | Visual color scheme |
variant | "solid" | "soft" | "outline" | "ghost" | "solid" | Button style variant |
size | "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "md" | Control height and default gutter/icon size |
mobileMaterial | "glass" | "flat" | — | Phone surface for neutral soft/ghost buttons |
pill | boolean | false | Fully rounded corners |
block | boolean | false | Full width |
uniform | boolean | false | Square icon button (width equals height) |
disabled | boolean | false | Visually and accessibly disabled; click is not emitted |
disabled-tone | "relaxed" | — | Default cursor instead of not-allowed while disabled |
loading | boolean | false | Shows loading indicator |
inert | boolean | loading | Accessibly disabled without visual change |
selected | boolean | false | Selected state styling |
optically-align | "start" | "end" | — | Offset gutter for optical alignment |
gutter-size | "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | — | Horizontal padding size; defaults from size |
icon-size | "sm" | "md" | "lg" | "xl" | "2xl" | — | Size of icons in the slot; defaults from size |
type | "button" | "submit" | "reset" | "button" | Native button type |
@click | (event: MouseEvent) => void | — | Emitted on click, unless disabled |
Styling
Button reads these component tokens. Override them at any scope to restyle it:
--button-font-weight: font weight (defaultvar(--font-weight-medium))--button-gap-lg: gap lg (default6px)--button-gap-md: gap md (default4px)--button-gap-sm: gap sm (default3px)--button-icon-only-gutter-scale: share of the gutters an icon-only button withoutuniformkeeps (default1;0on a phone)--button-icon-only-min-width: least width of an icon-only button withoutuniform(defaultauto; the button's own size on a phone, a circle)--button-outline-background: fill of the outline variant (defaulttransparent)