# `FrappeUIPhx.Components.Button`
[🔗](https://github.com/moacirbishopcamata/frappe_ui_phx/blob/v0.3.1/lib/frappe_ui_phx/components/button.ex#L1)

Botão do Frappe UI: variantes `solid | subtle | outline | ghost`, temas
`gray | blue | green | red`, tamanhos `xs | sm | md | lg`.

Vira `<.link>` quando recebe `href`, `navigate` ou `patch` (e não está
inerte); caso contrário é um `<button>`. Com `loading`, mostra o spinner e
fica inerte, mas mantém o visual normal (igual ao original).

# `button`

## Attributes

* `theme` (`:atom`) - Defaults to `:gray`. Must be one of `:gray`, `:blue`, `:green`, or `:red`.
* `variant` (`:atom`) - Defaults to `:subtle`. Must be one of `:solid`, `:subtle`, `:outline`, or `:ghost`.
* `size` (`:atom`) - Defaults to `:sm`. Must be one of `:xs`, `:sm`, `:md`, or `:lg`.
* `label` (`:string`) - Defaults to `nil`.
* `icon` (`:string`) - botão só com ícone (nome Lucide). Defaults to `nil`.
* `icon_left` (`:string`) - Defaults to `nil`.
* `icon_right` (`:string`) - Defaults to `nil`.
* `loading` (`:boolean`) - Defaults to `false`.
* `loading_text` (`:string`) - Defaults to `nil`.
* `disabled` (`:boolean`) - Defaults to `false`.
* `type` (`:string`) - Defaults to `"button"`.
* `class` (`:any`) - Defaults to `nil`.
* Global attributes are accepted. Supports all globals plus: `["href", "navigate", "patch", "method", "download", "name", "value", "form"]`.
## Slots

* `inner_block`

# `classes`

```elixir
@spec classes(map()) :: [String.t() | nil]
```

Classes do botão para a combinação de atributos. Função pura, testável sem renderizar.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
