> ## Documentation Index
> Fetch the complete documentation index at: https://filament-34a8cf01.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Rendering a widget in a Blade view

> [!WARNING]
>
> You are currently viewing the documentation for Filament 4.x, which is a previous version of Filament.
>
> Looking for the current stable version? Visit the [5.x documentation](https://filament-34a8cf01.mintlify.site/5.x/components/widget.md).

> [!WARNING]
>
> Before proceeding, make sure `filament/widgets` is installed in your project. You can check by running:
>
> ```bash theme={"theme":"gruvbox-dark-hard"}
> composer show filament/widgets
> ```
>
> If it's not installed, consult the [installation guide](https://filament-34a8cf01.mintlify.site/4.x/introduction/installation.md#installing-the-individual-components) and configure the **individual components** according to the instructions.

## Creating a widget

Use the `make:filament-widget` command to generate a new widget. For details on customization and usage, see the [widgets section](../widgets).

## Adding the widget

Since widgets are Livewire components, you can easily render a widget in any Blade view using the `@livewire` directive:

```blade theme={"theme":"gruvbox-dark-hard"}
<div>
    @livewire(\App\Livewire\Dashboard\PostsChart::class)
</div>
```

> [!NOTE]
>
> If you're using a [table widget](https://filament-34a8cf01.mintlify.site/4.x/widgets/overview.md#table-widgets), make sure to install `filament/tables` as well.\
> Refer to the [installation guide](https://filament-34a8cf01.mintlify.site/4.x/introduction/installation.md#installing-the-individual-components) and follow the steps to configure the **individual components** properly.

[Edit this page on GitHub](https://github.com/filamentphp/filament/edit/4.x/docs/12-components/02-widget.md)

## Sponsored by

[Your logo here](https://github.com/sponsors/danharrin)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.