Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RenderFragments as a Component Parameter #19

Open
Kristianfriis opened this issue Nov 24, 2023 · 1 comment
Open

RenderFragments as a Component Parameter #19

Kristianfriis opened this issue Nov 24, 2023 · 1 comment

Comments

@Kristianfriis
Copy link

Kristianfriis commented Nov 24, 2023

Hey there,
First of, big thanks for bringing Storybook to Blazor.

I am having a usecase where a button component has a RenderFragtment for ChildComponents.
This is mostly for the text inside a label. I would like to make it possible to insert text in the Controls panel BlazingStory provides, but it is ever only a "-".

image

I am setting up the Story as follows:

<Stories TComponent="AsButton">
    <ArgType For="_=>_!.Look" Control="ControlType.Select" />
    <ArgType For="_=>_!.Icon" Control="ControlType.Select" />
    <ArgType For="_=>_!.IconPosition" Control="ControlType.Select" />
    <ArgType For="_=>_!.TextSize" Control="ControlType.Select" />
    <ArgType For="_=>_!.Color" Control="ControlType.Select" />
    <ArgType For="_=>_!.Block" Control="ControlType.Select" />

    <Story Name="As Button">
        <Arguments>
            <Arg For="_ => _!.Look" Value="AsButtonLook.Active" />
            <Arg For="_ => _!.TextSize" Value="AsFontSizes.One" />
            <Arg For="_ => _!.Icon" Value="AsIcons.Gear" />
            <Arg For="_ => _!.Color" Value="AsTextColors.Default" />
            <Arg For="_ => _!.IconPosition" Value="AsPosition.Default" />
            <Arg For="_ => _!.Block" Value="@false" />
        </Arguments>

        <Template>
            <AsButton
                OnClick="@(OnClick)"
                @attributes="context.Args">
                Test
            </AsButton>
        </Template>
    </Story>

</Stories>
@jsakamoto
Copy link
Owner

@Kristianfriis Thank you for the proposal.
Could you try out the latest version of Blazing Story? I supported RenderFragment in the parameter control UI. And don't forget to check out the document https://github.com/jsakamoto/BlazingStory#configure-component-parameters-which-type-is-renderfragment before you try it.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants