Create a custom text widget
Hello, i am trying to creata a widget for in my dashboard.
I just want a text widget with some text in it and a button at the bottom that takes me to one of my resources
15 Replies
yes i know how to create a widget with that command, im talking about inside the actuall widget.
Do you have a blade file to add what you want
<x-filament-widgets::widget>
<x-filament::section>
{{-- Widget content --}}
<div>
<p>Widget Content</p>
<button id="chargerButton" style="display: none;">Button</button>
</div>
</x-filament::section>
</x-filament-widgets::widget>
idk if this is what you mean but this is an example of kinda waht i want in it
yes it is... you can also use blade components like button
https://filamentphp.com/docs/3.x/support/blade-components/button#overview
What do you currently have and where is the isssue?
this is my dashboard:
and what i want to add is one (later 3) box it has to have a title, a lttle description and a button that takes me to one of my resources.
onboarding-overview.blade.php:
<x-filament-widgets::widget>
<x-filament::section>
{{-- Widget content --}}
<div>
<p>Widget Content</p>
<button id="chargerButton" style="display: none;">Button</button>
</div>
</x-filament::section>
</x-filament-widgets::widget>
i made this example in a blade
im sorry if i seem dumb, im really sick today and cant think straight
and im really new to filament
Okay. And you have created the
OnboardingOverviewWidget
?yes
that currently looks like this:
<?php
namespace App\Filament\App\Widgets;
use Filament\Widgets\Widget;
class OnboardingOverview extends Widget
{
protected static string $view = 'filament.app.widgets.onboarding-overview';
} EDIT
} EDIT
A base widget should be enough, since you overwrite the view anyway.
The widget is not showing at all? Try adding it in your panel provider
->widgets()
(even though they should be auto-detected)Solution
oh wait it does show now.
only thin is the button is not showing
never mind that is fixed now
thank u both so much
i think i can handle the styling myself
Because it was
display: none
? π
yeahh im stupid, lmao found it out
im very good at overlooking stuff lol