area17 / blast

Storybook for Laravel Blade 🚀

Home Page:https://dev.to/area17/getting-started-with-blast-storybook-for-laravel-blade-c5c

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to pass args to story as an array?

RobertByrnes opened this issue · comments

Hi @mrtimbrook is this supported and I am missing something? I have been so far able to pass an array to the story so it registers in the controls addon effectively but only gets passed to the components blade as a bool?

Hi. Yep, arrays are supported. Can you send over an example of one that's causing you an issue?

Does this work for you?

@storybook([
    'args' => [
        'testArray' => [
            'item1', 'item2', 'item3'
        ]
    ]
])

@foreach ($testArray as $item)
    <p>{{ $item }}</p>
@endforeach

Will do...cheers