> For the complete documentation index, see [llms.txt](https://klassdocs.gitbook.io/klassapp-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://klassdocs.gitbook.io/klassapp-documentation/design/system/components/actions/button.prompt.md).

# Button.prompt

The KlassApp action button — use for every clickable action; renders an `<a>` when `href` is set.

```jsx
<Button variant="primary" type="submit">Save Changes</Button>
<Button variant="success" size="sm">Record Payment</Button>
<Button variant="ghost" size="sm" href="/admin/standards">← Back</Button>
```

### Variants

`primary` (default, green) · `success` (green, money/confirm) · `danger` · `warning` · `outline` (cancel) · `ghost` (back link).

**Primary is green, not blue.** `--d-accent` resolves to `--d-green`. Blue is informational only.

### Sizes

`sm` · `md` (default) · `lg`. `.ds-btn-md` has **no rule** in the app stylesheet, so the default renders at the `.ds-btn` base size (8px/18px padding, 0.85rem). Pass `sm` or `lg` when you want a deliberate size. Every button carries `min-height: 44px` for touch.

### Disabled

On a `<button>` this sets `disabled` (50% opacity, `--d-disabled-bg`). On an `<a>` it sets `aria-disabled="true"` and `tabindex="-1"` — the link keeps its `href`.

### States

Hover darkens the fill (`--d-accent-dk`); press is `scale(0.97)`; focus-visible is a 2px blue outline at 2px offset.

* **Loading (proposed):** `loading` prepends a 14px `currentColor` spinner and sets `aria-busy`; the label stays so width never changes.
* **`v2` (proposed):** AA-passing warning fill (`--d-warning`, 5.02:1) and single-dim disabled.
* **`success` is retired** — renders as primary. Don't use it in new work; `--d-success` remains for badges and alerts.
* All sizes render 44px tall (global touch-target rule); `sm` differs only in padding-x and font size.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://klassdocs.gitbook.io/klassapp-documentation/design/system/components/actions/button.prompt.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
