Infolist extraAttributes didn't work for tailwindcss
I can't change my color or css using the tailwindCSS class. I have done according to the documentation
https://filamentphp.com/docs/3.x/infolists/installation#installing-tailwind-css
Here is my code
public static function infolist(Infolist $infolist): Infolist
{
return $infolist
->schema([
Section::make([
Grid::make(2)->schema([
ImageEntry::make('course_photo')
->hiddenLabel(),
TextEntry::make('course_name')
->extraAttributes(['class' => 'text-lg text-blue-500 font-bold'])
->hiddenLabel(),
]),
]),
]);
}
13 Replies
Anyone have suggest for me?
Did you compile your assets by running
npm run dev
?absolutely

the text should be blue
Are you trying to display inside panel (filamentPHP) or separate TALL stack infolist builder?
Hi, for your styling attributes, you can just simply use:
https://filamentphp.com/docs/3.x/infolists/entries/text#customizing-the-text-size
I want to change the style of my infolist in Resource.
Thanks for your suggestion, I think by using extraAttributes, we have more freedom to change the appearance using TailwindCSS.
Is it possible to create a view with action buttons using only Infolist? Or do you have any suggestions?

It looks like you're using admin panel, so you have to create a custom theme like this and follow the instruction.. https://filamentphp.com/docs/3.x/panels/themes#creating-a-custom-theme
The link in OP is for using infolist as a standalone (outside of panel)..
Yes it is. You're going to need to create a theme for that.
okeey Thank you very much guys!!
@Ye Thi Ha Htwe @Vp
For your reference, Porvilas has created a video for this.
https://www.youtube.com/watch?v=DrR6tfVYZsQ
Filament Daily
YouTube
Filament: Change CSS Styles with Custom Theme
Answering a question about how to customize login/register page, but with a broader concept that you can apply to any other pages.
Docs:
- Style customization: https://filamentphp.com/docs/3.x/support/style-customization
- Creating a custom theme: https://filamentphp.com/docs/3.x/panels/themes#creating-a-custom-theme