- How do I install Sparky in a Laravel application?
- Install it with Composer using composer require awcodes/sparky, then render the sparkline directly in a Blade view or Filament widget. Because the package ships a single 0.1.0 release, pin the version in composer.json rather than floating on a loose constraint. Before installing, confirm the artifact identity at the pinned commit, since the registry description (sparkline renderer) and the repository contents (Filament starter kit) do not currently agree.
- Does Sparky require JavaScript, Chart.js, or an asset build step?
- Sparky is described as producing clean inline SVG with zero JavaScript dependencies, so no npm install, Vite build, or charting library is involved. That is the main reason it suits stat cards and dashboards where you do not want another front-end asset pipeline to maintain. Verify this against the source before adopting: check that the output is genuinely inline SVG and not a wrapper around a headless charting library, because the latter reintroduces an asset pipeline and an extra dependency you would own.
- Can I pass an array or an Eloquent collection of values to Sparky?
- Yes. Sparky accepts plain PHP arrays or Laravel collections of numeric values, where each value becomes one point in the trend line. In practice you map model data to a flat sequence, for example a collection plucked from an orders table or a query builder result, and hand it to the component. There is no requirement for timestamps or labelled axes, since a sparkline shows shape rather than precise readings.
- How do I customize sparkline colors, width, height, and stroke width?
- The package exposes configurable colors, dimensions, and stroke width, typically through the Blade component's attributes and an optional published config file. Practical use is to keep a default in config for your stat cards and override per instance where a trend needs to signal good or bad movement, such as green for growth and red for decline. Keep the values small, since sparklines are meant to be read at a glance inside a card rather than as a full chart.
- Does Sparky work inside Filament dashboard widgets and stat cards?
- The package is explicitly aimed at stat cards and Filament dashboard widgets, so a sparkline can sit alongside a headline number as a quick trend indicator. Because the output is inline SVG, it renders inside a Livewire component without extra wiring or a chart initialisation step on the client. If you are on Filament 4 with Livewire 4, test the widget after any Livewire upgrade, since child-event and wire:model semantics can change behaviour silently.
- Which Laravel and PHP versions does Sparky support?
- The available metadata does not state a support matrix, and the project has only a single 0.1.0 release, so treat version support as unconfirmed. Inspect composer.json at the pinned commit to see the actual PHP, Laravel, and Filament constraints before planning adoption. There is also no published upgrade policy against Laravel, Filament, or Livewire majors, which matters more than the install itself.
- Is Sparky a sparkline package or a Filament starter kit?
- That is the unresolved question. The registry description and blurb describe a lightweight sparkline renderer, while the repository, the v0.1.0 release, and the bundled agents and skills tree describe a Filament starter kit built on Filament, Blueprint, Boost, Flux, and Pest 4. The two are different products with different risk profiles and different integration costs, so inspect the pinned commit for composer.json, a panel provider, and an agents/skills directory before writing any code. Record the resolution in writing, because ambiguous package metadata will send coding agents down the wrong path.
- Is Sparky mature enough to use in production?
- It has roughly 13 stars, zero dependents, one release, and one maintainer, so there is no ecosystem signal to lean on. For the sparkline case the runtime risk is low because rendering inline SVG is a narrow, side-effect-free job, but treat the project as inspiration rather than a dependency feed. If you adopt it, pin the commit, vendor it if necessary, and plan to own upgrades yourself.
- How do I test sparkline output in my test suite?
- Because the output is deterministic SVG markup, snapshot or assertion-based tests work well. Render the component in a Pest or PHPUnit test and assert the response contains the expected svg element, viewBox dimensions, stroke colour, and point count. Add a test that covers the empty and single-value cases, since a flat or zero-length series is the most likely visual edge case in a stat card.
- What are the alternatives if Sparky does not fit my project?
- For simple trends you can hand-write a few lines of inline SVG that map values to a polyline, which removes the dependency entirely and costs an afternoon. If you need axes, tooltips, or interaction, use a proper charting package or Filament's chart widgets, accepting the JavaScript and asset pipeline they bring. If the repository turns out to be a starter kit rather than a package, the comparison set changes completely: evaluate it against laravel new, the Filament installer, and your own org template repo instead.