Using Flux UI on Custom Page

Has anyone been able to integrate Caleb Porzio's Flux UI into a custom page? I think the main issue is how to get @fluxStyles into the head and @fluxScripts into the body of the Filament layout? Any ideas?
2 Replies
awcodes
awcodes2d ago
Haven’t tried it but you can use render hooks to inject them. I’d be surprised if there weren’t stying conflicts though.
rubendn
rubendnOP2d ago
Thanks for the suggestion.
I did the following in the boot method of the AppServiceProvider and it seems to work. Haven't noticed any conflicts yet.
FilamentView::registerRenderHook(
PanelsRenderHook::HEAD_END,
fn (): string => Blade::render('@fluxStyles'),
);
FilamentView::registerRenderHook(
PanelsRenderHook::BODY_END,
fn (): string => Blade::render('@fluxScripts'),
);
FilamentView::registerRenderHook(
PanelsRenderHook::HEAD_END,
fn (): string => Blade::render('@fluxStyles'),
);
FilamentView::registerRenderHook(
PanelsRenderHook::BODY_END,
fn (): string => Blade::render('@fluxScripts'),
);
Want results from more Discord servers?
Add your server