kainiklas/filament-inline-gauge
A Filament plugin that adds an inline gauge column for showing numeric values as compact visual indicators directly in resource tables, with customizable styling and thresholds for quick at-a-glance status.
kainiklas/filament-gauge renders an inline SVG gauge — useful anywhere you'd otherwise show a bare percentage in a Filament panel (KPI columns, score tables, progress-style widgets).
Important — v0.2.0 is a breaking release: it renames the project. Before following any tutorial, blog post, or old README snippet, confirm you're on the v0.2.x package name. If you're upgrading from v0.1.x, treat this as a migration, not a bump:
composer remove kainiklas/<old-package-name>
composer require kainiklas/filament-gauge:^0.2
Then grep your app for anything referencing the old package name — composer.json, use statements, published config/views, Blade @includes, and any ->view('...') overrides. The new feature (CSS hooks) is additive and safe; the rename is not.
Minimal first use case — a gauge column in a resource table:
use Kainiklas\FilamentGauge\Tables\Columns\GaugeColumn; // verify namespace in the v0.2 README
GaugeColumn::make('completion_rate')
->label('Completion'),
Where to look first:
master, not your memory of v0.1.vendor/kainiklas/filament-gauge/ — check composer.json (extra.laravel, psr-4), config/, and resources/views/ to see the real class namespaces and Blade structure after the rename.Table columns are the primary surface. Bind the gauge to a numeric attribute that's already on the model or a computed accessor. Keep the raw number visible too (->numeric() next to it, or a tooltip) — gauges are a glanceable summary, not a precise readout.
Normalize your scale in one place. If values are 0–100, 0–1, or arbitrary ranges, either pass the max/min explicitly on the column or wrap it in a model accessor. Doing the conversion inline in a dozen resources is how inconsistent gauges happen.
Forms and infolists. Gauges work well in read-only contexts — Placeholder, ViewField, or inside a custom widget. Avoid them in editable inputs; a gauge is an output, not an input, and swapping it into a form field confuses users about what's interactive.
Styling via the new CSS hooks (v0.2.0). This is the release's headline feature. Add rules to your Filament custom theme stylesheet rather than overriding the package's Blade views — view overrides break silently on the next patch.
/* resources/css/filament/admin/theme.css */
.fi-gauge { /* inspect the rendered markup for the exact hook names */ }
Rebuild after editing: npm run build. Because the hooks are new, inspect the actual DOM in the browser to get the real class/custom-property names — don't assume they match a convention.
Threshold-based coloring. Prefer a single reusable accessor or column factory (e.g. a GaugeColumn::make(...)->color(fn ($state) => ...)) over per-column closures, so a color-scheme change is one edit. Combine this with the CSS hooks: PHP decides which semantic state (good/warn/bad), CSS decides what that state looks like.
Dashboards and widgets. Gauges are compact enough to sit three-to-a-row in a stats overview widget. Pass pre-aggregated values from the widget query — don't let the column do per-row calculations across a large dataset.
composer remove both before you install to avoid two copies fighting over the same view namespace.php artisan view:clear && php artisan optimize:clear, then php artisan filament:assets. Filament caches component views aggressively; old Blade paths will survive a naive cache:clear.content globs of your tailwind.config.js (or @source directives in Tailwind v4). Symptom: the gauge renders but is unstyled in production while fine in dev.style attribute on the SVG elements (SVG fill/stroke are commonly set inline and can't be beaten by a class without !important or a custom property).0.3.0 can break you the same way 0.2.0 just did. Pin to ^0.2 with a committed composer.lock and read changelogs before running composer update.resources/views/vendor/ pointing at the old namespace. The last one is easy to miss and silently wins over the package view.How can I help you explore Laravel packages today?