Xzero UI
Pro library

Button

A clear, responsive action with quiet secondary states.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/button
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/button

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { Button } from "@/components/xzero/button/button";

export function SaveBar() {
  return (
    <Button variant="primary" loading={saving} onClick={save}>
      Save changes
    </Button>
  );
}

Examples

Label that morphs after saving

<Button variant="secondary" loading={saving} onClick={save}>
  {saved ? "Saved" : "Save draft"}
</Button>

API reference

Button

A native button with press feedback and a label that morphs its width when the content changes.

PropTypeDefaultDescription
variant"primary" | "secondary" | "ghost" | "danger""primary"Visual weight. Use one primary action per surface.
size"sm" | "md" | "lg""md"Height and padding.
loadingbooleanfalseShows a spinner, sets aria-busy, and swallows clicks while keeping focus.
...propsButtonHTMLAttributes<HTMLButtonElement>–Forwarded to the underlying button, including ref, disabled, type, and onClick.

Keyboard interactions

KeysAction
Enter / SpaceActivates the button.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in buttons

Guidance for AI tools

Button: A clear, responsive action with quiet secondary states. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components