All Projects β†’ rbardini β†’ Storybook Addon Playroom

rbardini / Storybook Addon Playroom

Licence: mit
Design with Playroom inside Storybook, using each story source as a starting point

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Storybook Addon Playroom

Ui Ux
πŸ“ Curated list for UI/UX Designers
Stars: ✭ 125 (-6.02%)
Mutual labels:  design
Material Discord
Material design theme for Discord
Stars: ✭ 127 (-4.51%)
Mutual labels:  design
Involt
Inject hardware interactions directly into HTML layout.
Stars: ✭ 128 (-3.76%)
Mutual labels:  design
Tachyons
Functional css for humans
Stars: ✭ 11,057 (+8213.53%)
Mutual labels:  design
Fooddelivery
Design OO food delivery app with C# & Design Patterns
Stars: ✭ 126 (-5.26%)
Mutual labels:  design
Jstoxml
JavaScript object to XML converter (useful for RSS, podcasts, GPX, AMP, etc)
Stars: ✭ 127 (-4.51%)
Mutual labels:  jsx
Ink Gradient
Gradient color component for Ink
Stars: ✭ 123 (-7.52%)
Mutual labels:  jsx
Motion
A library used to create beautiful animations and transitions for iOS.
Stars: ✭ 1,726 (+1197.74%)
Mutual labels:  design
Blueesc
Simple, open-source ESC that uses the SimonK firmware.
Stars: ✭ 126 (-5.26%)
Mutual labels:  design
Preact And Typescript
Some simple patterns for Typescript usage with Preact
Stars: ✭ 127 (-4.51%)
Mutual labels:  jsx
Simple Icons
SVG icons for popular brands
Stars: ✭ 12,090 (+8990.23%)
Mutual labels:  design
Sexytooltip
The tooltip that has all the right moves
Stars: ✭ 125 (-6.02%)
Mutual labels:  design
Patchfluent
πŸ’§ πŸ¦„ Customize Windows 10 Updates
Stars: ✭ 128 (-3.76%)
Mutual labels:  design
Awesome Product Design
A collection of bookmarks, resources, articles for product designers.
Stars: ✭ 1,679 (+1162.41%)
Mutual labels:  design
Hyperapp One
Hyperapp One is a Parcel boilerplate for quickstarting a web application with Hyperapp (V1), JSX, and Prettier.
Stars: ✭ 129 (-3.01%)
Mutual labels:  jsx
Low Level Design Primer
Dedicated Resources for the Low-Level System Design. Learn how to design and implement large-scale systems. Prep for the system design interview.
Stars: ✭ 2,706 (+1934.59%)
Mutual labels:  design
Design Resources
πŸ“ Select websites, tools, assets, and readings for working in and learning about design.
Stars: ✭ 127 (-4.51%)
Mutual labels:  design
Neumorphismui
NeumorphismUI is a library that can be used with SwiftUI. Compatible with Swift Package Manager.
Stars: ✭ 133 (+0%)
Mutual labels:  design
Arclayout
With Arc Layout explore new styles and approaches on material design
Stars: ✭ 1,662 (+1149.62%)
Mutual labels:  design
Bhban rpa
6κ°œμ›” 치 업무λ₯Ό ν•˜λ£¨ λ§Œμ— λλ‚΄λŠ” 업무 μžλ™ν™”(생λŠ₯μΆœνŒμ‚¬, 2020)의 예제 μ½”λ“œμž…λ‹ˆλ‹€. νŒŒμ΄μ¬μ„ ν•œ λ²ˆλ„ λ°°μ›Œλ³Έ 적 μ—†λŠ” 뢄듀을 μœ„ν•œ 예제이며, μ—‘μ…€λΆ€ν„° λ””μžμΈ, 맀크둜, ν¬λ‘€λ§κΉŒμ§€ 업무 μžλ™ν™”μ™€ κ΄€λ ¨λœ λ‹€μ–‘ν•œ λΆ„μ•Ό μ˜ˆμ œκ°€ μ œκ³΅λ©λ‹ˆλ‹€.
Stars: ✭ 124 (-6.77%)
Mutual labels:  design

Storybook Playroom Addon

npm package version Build status Dependencies status devDependencies status

Design with Playroom inside Storybook, using each story source as a starting point.

Live demo

Demo

Installation

npm install --save-dev storybook-addon-playroom

within .storybook/main.js:

module.exports = {
  addons: ['storybook-addon-playroom'],
};

See example for a minimal working setup.

Configuration

The addon can be configured via the playroom parameter. The following options are available:

Option Type Description Default
url string the Playroom URL http://localhost:9000
code string code to be used instead of story source
disable boolean whether to disable the addon false
reactElementToJSXStringOptions object react-element-to-jsx-string options { sortProps: false }

To configure for all stories, set the playroom parameter in .storybook/preview.js:

export const parameters = {
  playroom: {
    url: 'http://localhost:9000',
  },
};

You can also configure on per-story or per-component basis using parameter inheritance:

// Button.stories.js

// Use predefined code instead of story source in all Button stories
export default {
  title: 'Button',
  parameters: {
    playroom: {
      code: '<Button>Hello Button</Button>',
    },
  },
};

// Disable addon in Button/Large story only
export const Large = Template.bind({});
Large.parameters = {
  playroom: {
    disable: true,
  },
};

Note: Disabling the addon does not hide the Playroom tab from preview. For that, you must use Storybook's own previewTabs parameter:

Story.parameters = {
  previewTabs: {
    'storybook/playroom/panel': {
      hidden: true,
    },
  },
};

Generating Playroom snippets from stories

Note: This is an experimental feature.

Playroom addon comes with a sb-playroom CLI tool that can auto-generate Playroom snippets from Storybook stories via the gen-snippets command:

$ sb-playroom gen-snippets --help
Usage: sb-playroom gen-snippets [options] [config-dir]

generate Playroom snippets from stories (experimental)

Options:
  -o, --out-file <path>     output file (default: "snippets.json")
  -c, --config-file <path>  Babel config file
  -h, --help                display help for command

By default, gen-snippets will fetch the Storybook configuration from the .storybook directory and output the snippets to a snippets.json file. Different input and output paths can be passed as arguments.

You can then reference the output file in playroom.config.js.

Babel configuration

Because Playroom addon programmatically runs Storybook to collect story sources, Babel is used to compile stories on the fly. If the loaded Babel configuration does not work with your Storybook, a Babel config file can be defined with the -c, --config-file option.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].