# Widget

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

as we get the Widget Facade service to register the widgets to the dashboard homepage, we get this component to register the same widgets anywhere.

### Use

you can use it like this

```html
<x-tomato-admin-widget
    :counter="300"
    :title="__('Projects')"
    icon="bx bx-category"
/>
```

or you can just pass a direct model and we will count it

```html
<x-tomato-admin-widget
    model="User::class"
    :title="__('Projects')"
    icon="bx bx-category"
/>
```

and you can change the query like this

```html
<x-tomato-admin-widget
    model="User::class"
    :query="[
        'is_activated' => true
    ]"
    :title="__('Projects')"
    icon="bx bx-category"
/>
```


---

# Agent Instructions: 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/widget.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.
