| Install | |
|---|---|
composer require slym758/filament-mobile-table |
|
| Latest Version: | v1.1.0 |
| PHP: | ^8.1|^8.2|^8.3 |
Transform your Filament tables into beautiful, responsive card layouts on mobile devices. Automatically converts table rows to cards with featured fields, custom colors, and multiple layout options.
Desktop View (Normal Table)

Mobile View (Card Layout)

Featured Field with Custom Color

Install the package via composer:
composer require mobile-cards/filament-mobile-table
The package will automatically register itself via Laravel's package discovery.
If auto-discovery is disabled, add the service provider to config/app.php:
'providers' => [
// ...
MobileCards\FilamentMobileTable\FilamentMobileTableServiceProvider::class,
],
No additional configuration needed! The plugin automatically registers its assets. However, if you want to manually register assets in your AdminPanelProvider, you can:
use Filament\Panel;
public function panel(Panel $panel): Panel
{
return $panel
// ... other config
->plugins([
// Plugin automatically loads, no registration needed
]);
}
The simplest way to enable mobile cards:
use Filament\Tables\Table;
use Filament\Tables\Columns\TextColumn;
public static function table(Table $table): Table
{
return $table
->mobileCards() // Enable mobile cards
->columns([
TextColumn::make('name'),
TextColumn::make('email'),
TextColumn::make('status'),
]);
}
That's it! Your table will now display as cards on mobile devices (screens < 1024px).
Highlight an important field with a colored gradient background:
public static function table(Table $table): Table
{
return $table
->mobileCards()
->mobileCardFeatured('price', 'emerald') // Column name, color
->columns([
TextColumn::make('product_name'),
TextColumn::make('price')->money('TRY'),
TextColumn::make('stock'),
]);
}
Default color: blue (if no color specified)
All Tailwind CSS colors are supported:
red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose, slate, gray, zinc, neutral, stone
Choose from 3 different card layouts:
public static function table(Table $table): Table
{
return $table
->mobileCards([
'layout' => 'compact', // default, compact, minimal
'columns' => 2, // Tablet columns: 1, 2, or 3
])
->columns([...]);
}
Layout Types:
Control how many columns appear on tablet devices (640px - 1024px):
->mobileCards([
'columns' => 1, // Single column (default: 2)
])
->mobileCards([
'columns' => 3, // Three columns for larger tablets
])
use Filament\Tables\Table;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Columns\BadgeColumn;
public static function table(Table $table): Table
{
return $table
->mobileCards([
'layout' => 'default',
'columns' => 2,
])
->mobileCardFeatured('total_price', 'green')
->columns([
TextColumn::make('order_number')
->label('Order #')
->searchable(),
TextColumn::make('customer.name')
->label('Customer'),
TextColumn::make('total_price')
->money('TRY')
->sortable(),
BadgeColumn::make('status')
->colors([
'success' => 'completed',
'warning' => 'pending',
'danger' => 'cancelled',
]),
TextColumn::make('created_at')
->dateTime('d/m/Y H:i'),
])
->filters([...])
->actions([...])
->bulkActions([...]);
}
All Filament table features work in card mode:
The plugin adds these classes for custom styling:
.fi-mobile-card-table /* Main table wrapper */
.fi-mobile-layout-{name} /* Layout modifier */
[data-featured="true"] /* Featured field */
[data-featured-color="{color}"] /* Color attribute */
Create a custom CSS file and register it in your panel provider:
use Filament\Support\Assets\Css;
public function panel(Panel $panel): Panel
{
return $panel
->assets([
Css::make('custom-mobile-cards', resource_path('css/custom-mobile-cards.css')),
]);
}
Example custom CSS:
@media (max-width: 1024px) {
.fi-mobile-card-table tr {
border-radius: 16px !important; /* More rounded corners */
}
.fi-mobile-card-table td[data-featured="true"] {
padding: 2rem !important; /* More padding on featured */
}
}
php artisan filament:cache-componentsphp artisan cache:clearphp artisan view:clearnpm run buildCheck that the column name matches exactly (case-sensitive):
->mobileCardFeatured('price') // Column must be named 'price'
->columns([
TextColumn::make('price'), // ✅ Matches
])
Please see CHANGELOG for recent changes.
Contributions are welcome! Please see CONTRIBUTING for details.
If you discover any security issues, please email security@example.com.
The MIT License (MIT). Please see License File for more information.