F
Filamentβ€’8mo 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
MexataOPβ€’8mo ago
yes i know how to create a widget with that command, im talking about inside the actuall widget.
LeandroFerreira
LeandroFerreiraβ€’8mo ago
Do you have a blade file to add what you want
Mexata
MexataOPβ€’8mo 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 Kochβ€’8mo ago
What do you currently have and where is the isssue?
Mexata
MexataOPβ€’8mo 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
MexataOPβ€’8mo 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 Kochβ€’8mo ago
Okay. And you have created the OnboardingOverviewWidget?
Mexata
MexataOPβ€’8mo 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 Kochβ€’8mo 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
Mexataβ€’8mo ago
oh wait it does show now.
Mexata
MexataOPβ€’8mo 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 Kochβ€’8mo ago
Because it was display: none? πŸ˜…
Mexata
MexataOPβ€’8mo ago
yeahh im stupid, lmao found it out im very good at overlooking stuff lol
Want results from more Discord servers?
Add your server