View Source PhxLiveStorybook.Stories.VariationGroup (phx_live_storybook v0.4.5)

A variation group is a set of similar variations that will be rendered together in a single preview <pre> block.

usage

Usage

  def variations do
    [
      %VariationGroup{
        id: :colors,
        description: "Different color buttons",
        variations: [
          %Variation{
            id: :blue_button,
            attributes: %{label: "A button", color: :blue }
          },
          %Variation{
            id: :red_button,
            attributes: %{label: "A button", color: :red }
          },
          %Variation{
            id: :green_button,
            attributes: %{label: "A button", color: :green }
          }
        ]
      }
    ]
  end

Link to this section Summary

Link to this section Types

@type t() :: %PhxLiveStorybook.Stories.VariationGroup{
  description: String.t() | nil,
  id: atom(),
  template: :unset | String.t() | nil | false,
  variations: [PhxLiveStorybook.Stories.Variation.t()]
}