Skip to content

Commit

Permalink
add story for switch component
Browse files Browse the repository at this point in the history
  • Loading branch information
woylie committed Dec 13, 2023
1 parent cfb329a commit 354dc13
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions priv/storybook/components/switch.story.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
defmodule Storybook.Components.Switch do
use PhoenixStorybook.Story, :component

def function, do: &Doggo.switch/1

def variations do
[
%VariationGroup{
id: :default,
variations: [
%Variation{
id: :on,
attributes: %{
label: "Subscribe",
checked: true,
phx_click: "toggle-subscription"
}
},
%Variation{
id: :off,
attributes: %{
label: "Subscribe",
checked: false,
phx_click: "toggle-subscription"
}
}
]
},
%VariationGroup{
id: :custom_text,
variations: [
%Variation{
id: :on,
attributes: %{
label: "Subscribe",
on_text: "yes",
checked: true,
phx_click: "toggle-subscription"
}
},
%Variation{
id: :off,
attributes: %{
label: "Subscribe",
off_text: "no",
checked: false,
phx_click: "toggle-subscription"
}
}
]
}
]
end
end

0 comments on commit 354dc13

Please sign in to comment.