> 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/widget.md).

# Widget

<figure><img src="https://117397612-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSlG6RrSDmGrQX2xjM6AT%2Fuploads%2FyCuXy1uHWhR5yZQoWJon%2Fimage.png?alt=media&amp;token=46364628-75be-4853-a41c-33310f3e14c3" 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"
/>
```
