# `PetalComponents.Button`
[🔗](https://github.com/petalframework/petal_components/blob/v3.2.0/lib/petal_components/button.ex#L1)

# `button`

## Attributes

* `size` (`:string`) - button sizes. Defaults to `"md"`. Must be one of `"xs"`, `"sm"`, `"md"`, `"lg"`, or `"xl"`.
* `radius` (`:string`) - button border radius. Defaults to `"md"`. Must be one of `"none"`, `"sm"`, `"md"`, `"lg"`, `"xl"`, or `"full"`.
* `variant` (`:string`) - button variant. Defaults to `"solid"`. Must be one of `"solid"`, `"light"`, `"outline"`, `"inverted"`, `"shadow"`, or `"ghost"`.
* `color` (`:string`) - button color. Defaults to `"primary"`. Must be one of `"primary"`, `"secondary"`, `"info"`, `"success"`, `"warning"`, `"danger"`, `"gray"`, `"pure_white"`, `"white"`, `"light"`, or `"dark"`.
* `to` (`:string`) - link path. Defaults to `nil`.
* `loading` (`:boolean`) - indicates a loading state. Defaults to `false`.
* `disabled` (`:boolean`) - indicates a disabled state. Defaults to `false`.
* `icon` (`:any`) - name of a Heroicon at the front of the button. Defaults to `nil`.
* `with_icon` (`:boolean`) - adds some icon base classes. Defaults to `false`.
* `link_type` (`:string`) - Defaults to `"button"`. Must be one of `"a"`, `"live_patch"`, `"live_redirect"`, or `"button"`.
* `class` (`:any`) - CSS class. Defaults to `nil`.
* `label` (`:string`) - labels your button. Defaults to `nil`.
* Global attributes are accepted. Supports all globals plus: `["method", "download", "hreflang", "ping", "referrerpolicy", "rel", "target", "type", "value", "name", "form"]`.
## Slots

* `inner_block`

# `icon_button`

## Attributes

* `size` (`:string`) - Defaults to `"sm"`. Must be one of `"xs"`, `"sm"`, `"md"`, `"lg"`, or `"xl"`.
* `color` (`:string`) - Defaults to `"gray"`. Must be one of `"primary"`, `"secondary"`, `"info"`, `"success"`, `"warning"`, `"danger"`, or `"gray"`.
* `radius` (`:string`) - button radius. Defaults to `"full"`. Must be one of `"none"`, `"sm"`, `"md"`, `"lg"`, `"xl"`, or `"full"`.
* `to` (`:string`) - link path. Defaults to `nil`.
* `loading` (`:boolean`) - indicates a loading state. Defaults to `false`.
* `disabled` (`:boolean`) - indicates a disabled state. Defaults to `false`.
* `with_icon` (`:boolean`) - adds some icon base classes. Defaults to `false`.
* `link_type` (`:string`) - Defaults to `"button"`. Must be one of `"a"`, `"live_patch"`, `"live_redirect"`, or `"button"`.
* `class` (`:any`) - CSS class. Defaults to `nil`.
* `tooltip` (`:string`) - tooltip text. Defaults to `nil`.
* Global attributes are accepted. Supports all globals plus: `["method", "download", "hreflang", "ping", "referrerpolicy", "rel", "target", "type", "value", "name", "form"]`.
## Slots

* `inner_block`

---

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