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

color

Sizing & roundness

variant
color
Small · sm · 28px
Medium · md · 34px
Large · xl · 50px

Icons

variant
color
sm · 28px
md · 34px
xl · 50px

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

variant

Optical alignment

opticallyAlign

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 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.

PropTypeDefaultDescription
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
pillbooleanfalseFully rounded corners
blockbooleanfalseFull width
uniformbooleanfalseSquare icon button (width equals height)
disabledbooleanfalseVisually and accessibly disabled; click is not emitted
disabled-tone"relaxed"—Default cursor instead of not-allowed while disabled
loadingbooleanfalseShows loading indicator
inertbooleanloadingAccessibly disabled without visual change
selectedbooleanfalseSelected 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 (default var(--font-weight-medium))
  • --button-gap-lg: gap lg (default 6px)
  • --button-gap-md: gap md (default 4px)
  • --button-gap-sm: gap sm (default 3px)
  • --button-icon-only-gutter-scale: share of the gutters an icon-only button without uniform keeps (default 1; 0 on a phone)
  • --button-icon-only-min-width: least width of an icon-only button without uniform (default auto; the button's own size on a phone, a circle)
  • --button-outline-background: fill of the outline variant (default transparent)