Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Shadcn Theme Laravel Package

irajul/filament-shadcn-theme

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Pros:

    • Non-intrusive: Leverages Filament’s plugin system, requiring minimal host application changes (only panel provider registration).
    • Design-System Alignment: Maps shadcn/ui tokens to Filament’s HTML output, enabling consistent theming without custom CSS/JS builds.
    • Lightweight: No Vite/asset compilation required by default (inline CSS mode), reducing build complexity.
    • Extensible: Supports token overrides, selector remapping, and style variables for customization.
    • Panel-Specific: Ideal for multi-panel Filament apps (e.g., admin vs. public dashboards).
  • Cons:

    • Tight Coupling to Filament: Limited utility outside Filament v5 ecosystems (e.g., Livewire, Inertia, or standalone Blade).
    • CSS Injection Overhead: Inline CSS mode may impact performance if overused; cached-asset mode requires public directory writability.
    • Limited Theming Granularity: Relies on predefined shadcn tokens; advanced customizations may still need manual CSS.

Integration Feasibility

  • Low Risk: Follows Laravel/Filament conventions (auto-discovery, panel plugins, config publishing).
  • Dependencies:
    • Hard: PHP 8.3+, Laravel 12/13, Filament 5 (non-negotiable).
    • Soft: Optional: filament-shadcn-theme:cache CLI commands (for cached-asset mode).
  • Conflicts:
    • Potential CSS specificity clashes if the host app or other Filament plugins inject custom styles for the same selectors.
    • Dark/light mode conflicts if Filament’s native theme mode differs from the package’s defaults.

Technical Risk

  • Medium:
    • CSS Conflicts: Inline CSS injection could override or be overridden by other packages/plugins. Mitigation: Use selectorMap for custom class targeting.
    • Performance: Cached-asset mode requires filesystem writes; inline mode may bloat HTML. Monitor bundle size in production.
    • Token Overrides: Incorrect token_overrides could break Filament’s expected CSS variables. Test thoroughly in staging.
    • Multi-Panel Apps: Plugin must be registered per panel; forgetfulness could lead to inconsistent theming.
  • Mitigations:
    • Start with cssMode: 'cached-asset' in production.
    • Use filament-shadcn-theme:clear to debug CSS issues.
    • Test dark/light mode transitions.

Key Questions

  1. Does the host app use multiple Filament panels?
    • If yes, ensure the plugin is registered in each PanelProvider.
  2. Are there existing CSS customizations for Filament components?
    • If yes, audit for selector conflicts before integration.
  3. Is dark/light mode toggling supported?
    • Verify Filament’s ThemeMode integration aligns with the package’s default_theme_mode.
  4. Will the app scale to >100 concurrent Filament users?
    • If yes, benchmark cached-asset mode vs. inline CSS performance.
  5. Are there custom Filament widgets/plugins with unique class names?
    • If yes, use selectorMap to ensure theme coverage.

Integration Approach

Stack Fit

  • Primary Use Case: Laravel + Filament v5 applications targeting a shadcn/ui-inspired design system.
  • Secondary Use Case: Apps requiring rapid theming without frontend build tools (e.g., marketing sites, internal tools).
  • Unsupported:
    • Non-Filament Laravel apps (e.g., Livewire-only, Inertia with custom frontend).
    • Filament v4 or earlier.
    • Apps using Tailwind CSS directly (redundant theming layer).

Migration Path

  1. Pre-Integration:
    • Audit existing Filament panels for custom CSS/JS.
    • Document current theme variables (e.g., --color-primary) for comparison.
  2. Installation:
    composer require irajul/filament-shadcn-theme
    php artisan vendor:publish --tag=filament-shadcn-theme-config
    
  3. Configuration:
    • Start with defaults in config/filament-shadcn-theme.php.
    • Override per-panel in PanelProvider (e.g., AdminPanelProvider).
  4. Testing:
    • Validate light/dark mode transitions.
    • Test all Filament components (tables, forms, modals) for visual consistency.
  5. Production:
    • Switch to cssMode: 'cached-asset' and run:
      php artisan filament-shadcn-theme:cache --panel=admin
      

Compatibility

  • High:
    • Filament Plugins: Works alongside most Filament plugins (e.g., Spatie Media Library, Filament Forms Tables).
    • Laravel Ecosystem: No conflicts with Blade, Livewire, or Inertia (themes are scoped to Filament panels).
  • Low:
    • Custom Filament Widgets: May require selectorMap if widgets use non-standard classes.
    • Third-Party CSS: Tailwind/Jetstream styles might need !important overrides.

Sequencing

  1. Phase 1: Single-panel integration (e.g., admin dashboard).
    • Focus on StyleVariant, BaseColor, and ThemeColor.
  2. Phase 2: Multi-panel rollout.
    • Reuse config file defaults; override per-panel as needed.
  3. Phase 3: Advanced customization.
    • Use token_overrides or styleVariables for edge cases.
  4. Phase 4: Performance optimization.
    • Benchmark cached-asset vs. inline mode; adjust based on user load.

Operational Impact

Maintenance

  • Pros:
    • Centralized Configuration: All theme logic lives in config/filament-shadcn-theme.php or PanelProvider.
    • No Asset Builds: Eliminates Vite/Webpack dependencies for theming.
    • Versioned Updates: MIT-licensed; easy to fork or patch if upstream stalls.
  • Cons:
    • Dependency on Upstream: Breaking changes in Filament v5 could require package updates.
    • CSS Debugging: Inline CSS may be harder to debug than compiled assets. Use browser dev tools to inspect generated <style> tags.
    • Token Management: Custom token_overrides must be manually maintained.

Support

  • Internal:
    • Training: Document the PanelProvider registration process and config options for developers.
    • Runbooks: Create a guide for clearing cached assets or troubleshooting CSS conflicts.
  • External:
    • Limited Community: Low GitHub stars/dependents may require internal triage for issues.
    • Fallback: Maintain a backup of original Filament CSS as a rollback option.

Scaling

  • Performance:
    • Inline CSS: Minimal impact until >1000 concurrent users (test with ab or Laravel Debugbar).
    • Cached-Asset Mode: Scales better but requires filesystem writes (monitor public/vendor/filament-shadcn-theme).
  • Resource Usage:
    • CPU/Memory: Token generation is lightweight; no significant overhead.
    • Database: No queries; purely frontend-themed.
  • Horizontal Scaling:
    • Stateless; no changes needed for queue workers or multi-server setups.

Failure Modes

Scenario Impact Mitigation
CSS injection conflicts Broken component styling Use selectorMap or disable plugin temporarily.
Cached-asset mode fails Missing styles in production Fallback to inline mode or regenerate assets.
Filament update breaks plugin Theme rendering fails Pin package version or fork the plugin.
Dark/light mode mismatch Inconsistent UI Align default_theme_mode with Filament’s ThemeMode.
Custom widget untargeted Missing theme styles Extend selectorMap or add manual CSS.

Ramp-Up

  • Developer Onboarding:
    • Time: 1–2 hours to configure and test a single panel.
    • Steps:
      1. Install and publish config.
      2. Register plugin in PanelProvider.
      3. Test light/dark mode and key components (tables, forms).
  • Design System Adoption:
    • Pros: Enables rapid iteration for designers (no frontend handoff).
    • Cons: Limited to Filament’s component library; complex layouts may still need custom CSS.
  • Rollback Plan:
    • Disable plugin in PanelProvider and revert to default Filament CSS.
    • Use Git to track config changes:
      git diff config/filament-shadcn-theme.php
      
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata