# Button

操作触发器，支持变体、尺寸和形状选项。与 LinkButton 共享样式。

**Install:** `nimbus-docs add button`  
**Source:** `src/components/ui/button/`  
**Canonical:** https://nimbus-docs.cn/components/button/

## Agent payload (JSON)

```json
{
  "slug": "button",
  "name": "Button",
  "description": "Action trigger with variant/size/shape options. Owns the shared button/variants styling that LinkButton reuses.",
  "tagline": "操作触发器，支持变体、尺寸和形状选项。与 LinkButton 共享样式。",
  "install": "nimbus-docs add button",
  "sourcePath": "src/components/ui/button/",
  "canonicalUrl": "https://nimbus-docs.cn/components/button/",
  "props": [
    {
      "name": "variant",
      "type": "\"primary\" | \"secondary\" | \"ghost\" | \"destructive\" | \"secondary-destructive\" | \"outline\"",
      "defaultValue": "\"secondary\"",
      "required": false,
      "description": "视觉样式。"
    },
    {
      "name": "size",
      "type": "\"xs\" | \"sm\" | \"base\" | \"lg\"",
      "defaultValue": "\"base\"",
      "required": false,
      "description": "相对尺寸；影响内边距和字号。"
    },
    {
      "name": "shape",
      "type": "\"base\" | \"square\" | \"circle\"",
      "defaultValue": "\"base\"",
      "required": false,
      "description": "用于纯图标按钮时选择 \"square\" 或 \"circle\"（需传入 aria-label）。"
    },
    {
      "name": "icon",
      "type": "string",
      "required": false,
      "description": "Iconify 图标名称，渲染在标签前，例如 \"ph:plus\"。"
    },
    {
      "name": "loading",
      "type": "boolean",
      "defaultValue": "false",
      "required": false,
      "description": "显示加载动画并禁用交互。"
    }
  ],
  "registryDependencies": [
    "cn"
  ],
  "dependencies": []
}
```
