Introduction
Filament is a Server-Driven UI (SDUI) framework for Laravel. It allows you to define user interfaces entirely in PHP using structured configuration objects, rather than traditional templating. Built on top of Livewire, Alpine.js, and Tailwind CSS, Filament empowers you to build full-featured interfaces like admin panels, dashboards, and form-based apps, all without writing custom JavaScript or frontend code.What is Server-Driven UI?
SDUI is a proven architecture used by companies like Meta, Airbnb, and Shopify. It moves control of the UI to the server, allowing for faster iteration, greater consistency, and centralized logic. Filament embraces this pattern for web development, letting you define interfaces declaratively using PHP classes that are rendered into HTML by the server.One key distinction to note is the difference between Server-Driven UI (SDUI) and Server-Rendered UI. While both approaches involve rendering content on the server, Server-Rendered UI relies on static templates (like traditional Blade views), where the structure and behavior of the UI are defined upfront in HTML or PHP files. In contrast, SDUI gives the server the power to dynamically generate the UI based on real-time configurations and business logic, allowing for more flexibility and reactivity without needing to modify frontend templates directly.
Packages
The core of Filament comprises several packages:filament/filament- The core package for building panels (e.g., admin panels). This requires all other packages since panels often use many of their features.filament/tables- A data table builder that allows you to render an interactive table with filtering, sorting, pagination, and more.filament/schemas- A package that allows you to build UIs using an array of âcomponentâ PHP objects as configuration. This is used by many features in Filament to render UI. The package includes a base set of components that allow you to render content.filament/forms- A set offilament/schemascomponents for a large variety of form inputs (fields), complete with integrated validation.filament/infolists- A set offilament/schemascomponents for rendering âdescription listsâ. An infolist consists of âentriesâ, which are key-value UI elements that can present read-only information like text, icons, and images. The data for an infolist can be sourced from anywhere but commonly comes from an individual Eloquent record.filament/actions- Action objects encapsulate the UI for a button, an interactive modal window that can be opened by the button, and the logic that should be executed when the modal window is submitted. They can be used anywhere in the UI and are commonly used to perform one-time actions like deleting a record, sending an email, or updating data in the database based on modal form input.filament/notifications- An easy way to send notifications to users in your appâs UI. You can send a âflashâ notification that appears immediately after a request to the server, a âdatabaseâ notification which is stored in the database and rendered in a slide-over modal the user can open on demand, or a âbroadcastâ notification that is sent to the user in real-time over a websocket connection.filament/widgets- A set of dashboard âwidgetsâ that can render anything, often statistical data. Charts, numbers, tables, and completely custom widgets can be rendered in a dashboard using this package.filament/support- This package contains a set of shared UI components and utilities used by all other packages. Users donât commonly install this directly, as it is a dependency of all other packages.
Plugins
Filament is designed to be highly extensible, allowing you to add your own UI components and features to the framework. These extensions can live inside your codebase if theyâre specific to your application, or be distributed as Composer packages if theyâre general-purpose. In the Filament ecosystem, these Composer packages are called âpluginsâ, and hundreds are available from the community. The Filament team also officially maintains several plugins that provide integration with popular third-party packages in the Laravel ecosystem. The vast majority of plugins in the ecosystem are open-source and free to use. Some premium plugins are available for purchase, often offering enhanced customer support and quality. You can browse an extensive list of official and community plugins on the Filament website.Customizing the appearance
Tailwind CSS is a utility-based CSS framework that Filament uses as a token-based design system. Although Filament does not use Tailwind CSS utility classes directly in the HTML rendered by its components, it compiles Tailwind utilities into semantic CSS. These semantic classes can be targeted by Filament users with their own CSS to modify the appearance of components, creating a thin layer of overrides on top of the default Filament design. A simple example demonstrating the power of this system is changing the border radius of all button components in Filament. By default, the following CSS code is used in the Filament codebase to style buttons using Tailwind utility classes:rounded-sm (small) utility class to .fi-btn in your own CSS file:
rounded-lg class with rounded-sm for all buttons in Filament while preserving the other styling properties of the button. This system provides a high level of flexibility to customize the appearance of Filament components without needing to write a complete custom stylesheet or maintain copies of HTML for each component.
For more information about customizing the appearance of Filament, visit the Customizing styling documentation.