Blast — Storybook UI Development for Laravel Blade

Packages

October 28th, 2021

storybook-browser-featured.png

Storybook for Laravel Blade is a package to build component libraries using Laravel. Blast lets you render examples of your app's components using the blade templating engine and Storybook Server within your Laravel app.

You can think of Storybook server as a UI development environment for your blade templates rendered by Laravel. This package makes it easy to iterate on components using Storybook:

1@storybook([
2 'args' => [
3 'label' => 'Button',
4 'href' => '#',
5 'icon' => 'menu-24',
6 'iconPosition' => 'after',
7 ]
8])
9 
10<x-button.primary
11 :href="$href ?? null"
12 :icon="$icon ?? null"
13 :iconPosition="$iconPosition ?? null"
14>
15 {{ $label ?? null }}
16</x-button.primary>

As you make changes to components, Blast will watch changes and automatically regenerate the stories and update Storybook. Once you get Blast installed in a new or existing Laravel app, the package provides various configuration options:

  • Storybook Server URL
  • Storybook Theme
  • Canvas Background Color
  • Configurable asset autoloading
  • And more

While Blast will help you get started quickly with Blade and Storybook, I'd recommend reading Getting Started with Blast – Storybook for Laravel Blade as well as the Storybook official docs.

You can learn more about this package, get full installation instructions, and view the source code on GitHub.

Filed in:

Paul Redmond

Full stack web developer. Author of Lumen Programming Guide and Docker for PHP Developers.