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?
3 Replies
awcodes
awcodes3mo 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
rubendnOP3mo 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'),
);
Jon Mason
Jon Mason4w ago
@rubendn Following up on this to see if you've seen any issues going this route? I'm interested in plugging in flux to use it in a couple of places and was curious what your experience has been so far? I mainly have a unique use-case where I need a searchable select blade component, and I know flux has a searchable select, so wondering if this would be pretty easy to incorporate or if you've run into headaches.

Did you find this page helpful?