View Source PhxLiveStorybook.Index (phx_live_storybook v0.4.5)

An index is an optional file you can create in every folder of your storybook content tree to improve rendering of the storybook sidebar.

The index files can be used:

  • to customize the folder itself: name, icon and opening status.
  • to customize folder direct children (only stories): name and icon.

Indexes must be created as index.exs files.

Read the icons guide for more information on custom icon usage.

usage

Usage

# storybook/_components.index.exs
defmodule MyAppWeb.Storybook.Components do
  use PhxLiveStorybook.Index

  def folder_name, do: "My Components"
  def folder_icon, do: {:fa, "icon"}
  def folder_open?, do: true

  def entry("a_component"), do: [name: "My Component"]
  def entry("other_component"), do: [name: "Another Component", icon: {:fa, "icon", :thin}]
end

Link to this section Summary

Functions

Convenience helper for using the functions above.

Link to this section Functions

Convenience helper for using the functions above.