Anonymous Components
Flux uses Laravel’s anonymous component system to provide a clean, intuitive syntax. Components are registered with theflux namespace prefix:
<flux:: syntax:
Component Resolution Order
Flux checks for components in this order:- Published components in
resources/views/flux(your customized versions) - Package components from the Flux vendor directory
Component Architecture
Flux components are structured as Blade templates with props, attributes, and slots:Props vs Attributes
Components distinguish between:- Props: Declared parameters with default values
- Attributes: Everything else passed to the component
variantis a prop (defined in @props)classandwire:clickare attributes
Custom Tag Compiler
Flux includes a custom tag compiler that extends Blade’s component compilation:- Self-closing Flux components (
<flux::icon icon="home" />) - Opening and closing tags (
<flux::button>...</flux::button>) - Inline slot attributes
- Special attribute handling
Blade Directives
Flux provides several Blade directives for asset inclusion:@fluxAppearance
Handles dark mode and appearance preferences:- Dark mode CSS (color-scheme)
- JavaScript to apply user’s appearance preference from localStorage
- System preference detection
@fluxScripts
Includes the Flux JavaScript bundle:- Automatically forces Livewire asset injection
- Loads the appropriate bundle (Pro or free version)
- Uses versioned URLs for cache busting
- Includes
data-navigate-oncefor Livewire navigation