F
Filament10mo ago
Mexata

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
Solution:
oh wait it does show now.
Jump to solution
15 Replies
Mexata
MexataOP10mo ago
yes i know how to create a widget with that command, im talking about inside the actuall widget.
LeandroFerreira
LeandroFerreira10mo ago
Do you have a blade file to add what you want
Mexata
MexataOP10mo ago
<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
Dennis Koch
Dennis Koch10mo ago
What do you currently have and where is the isssue?
Mexata
MexataOP10mo ago
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.
No description
Mexata
MexataOP10mo ago
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
Dennis Koch
Dennis Koch10mo ago
Okay. And you have created the OnboardingOverviewWidget?
Mexata
MexataOP10mo ago
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
Dennis Koch
Dennis Koch10mo ago
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
Mexata
Mexata10mo ago
oh wait it does show now.
Mexata
MexataOP10mo ago
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
Dennis Koch
Dennis Koch10mo ago
Because it was display: none? 😅
Mexata
MexataOP10mo ago
yeahh im stupid, lmao found it out im very good at overlooking stuff lol

Did you find this page helpful?