H-1: Support loading blocks in # Storybook #2278
Labels
area/blocks
Relates to first-party blocks (area)
area/dx
Improvements or additions to DX or docs
priority/3 low
Lower priority: nice-to-have
type/eng > frontend
Owned by the @frontend team
Context
We'd like to be able to load the contents of our
blocks
directory into the HASH Storybook instance (not to be confused with that recently set up in the Block Protocol repository):There are a number of different ways we could probably go about making blocks accessible within Storybook, including through the use of the Þ Dock (aka.
mock-block-dock
, or "MBD") as a decorator, wrapped into a Block Protocol add-on for Storybook.How a Þ Storybook add-on might work
Functionality
Flesh this out
We would create an add-on for Storybook.
We would use the Þ Dock as a decorator: https://storybook.js.org/docs/react/writing-stories/decorators
Location in monorepo
The code for the add-on would likely live within the
blockprotocol
repository'slibs
folder.Publishing the add-on
Once functional, the Storybook add-on could be published to
npm
and the add-on itself even listed in the public Storybook integrations library. The add-on could then be imported for use within both the # and Þ Storybook instances.Follow-ups
Unblocks H-3 and H-5.
The text was updated successfully, but these errors were encountered: