> For the complete documentation index, see [llms.txt](https://docs.tomatophp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tomatophp.com/tomato-admin/components/button.md).

# Button

<figure><img src="/files/XrwanhwL69YofHrHSl8X" alt=""><figcaption></figcaption></figure>

we are using buttons everywhere on the dashboard so we do 1 component to manage button types and button multi-style

## Use

you can add a new button like this

```html
<x-tomato-admin-button 
    :modal="true" 
    :href="route('admin.community-events.create')" 
    type="link"
>
    {{ __('Create User') }}
</x-tomato-admin-button>
```

or you can use it as an icon button inside a table like this

<figure><img src="/files/MzFKRY5SXboWW3dAb5ku" alt=""><figcaption></figcaption></figure>

```html
<x-tomato-admin-button 
    success 
    type="icon" 
    label="{{trans('tomato-admin::global.crud.view')}}" 
    modal 
    :href="route('admin.users.show', $item->id)"
>
    <x-heroicon-s-eye class="h-6 w-6"/>
</x-tomato-admin-button>
```

<figure><img src="/files/j5I2g4Sqs8z7AFh90ibR" alt=""><figcaption></figcaption></figure>

and the button works as well as the `x-splade-link` so you can create a delete button like this

```html
<x-tomato-admin-button 
    danger 
    type="icon" 
    label="{{trans('tomato-admin::global.crud.delete')}}" 
    :href="route('admin.bills.destroy', $item->id)"
    confirm="{{trans('tomato-admin::global.crud.delete-confirm')}}"
    confirm-text="{{trans('tomato-admin::global.crud.delete-confirm-text')}}"
    confirm-button="{{trans('tomato-admin::global.crud.delete-confirm-button')}}"
    cancel-button="{{trans('tomato-admin::global.crud.delete-confirm-cancel-button')}}"
    method="delete"
>
    <x-heroicon-s-trash class="h-6 w-6"/>
</x-tomato-admin-button>
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tomatophp.com/tomato-admin/components/button.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
