Gathering detailed insights and metrics for playroom
Gathering detailed insights and metrics for playroom
Gathering detailed insights and metrics for playroom
Gathering detailed insights and metrics for playroom
@design-systems/playroom
The playroom command for @design-systems-cli
@musical-patterns/playroom
The web-based UI for playing (with) the patterns. Just call `setupPlayroom` with whichever patterns you want.
@musical-patterns/pattern-playroom-test
just enough for the interface to be tested
@compositive/artifact-playroom
Compositive CLI plugin to integrate with Playroom.
npm install playroom
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (93.01%)
JavaScript (6.99%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
4,534 Stars
267 Commits
189 Forks
44 Watchers
25 Branches
52 Contributors
Updated on Jul 11, 2025
Latest Version
0.44.0
Package Id
playroom@0.44.0
Unpacked Size
2.03 MB
Size
1.75 MB
File Count
131
NPM Version
10.8.2
Node Version
20.19.0
Published on
Jun 11, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
50
23
Simultaneously design across a variety of themes and screen sizes, powered by JSX and your own component library.
Playroom allows you to create a zero-install code-oriented design environment, built into a standalone bundle that can be deployed alongside your existing design system documentation.
Braid Design System (Themed)
Cubes (Themed)
Mesh Design System (Themed)
Mística Design System (Themed)
Send us a PR if you'd like to be in this list!
1$ npm install --save-dev playroom
Add the following scripts to your package.json
:
1{ 2 "scripts": { 3 "playroom:start": "playroom start", 4 "playroom:build": "playroom build" 5 } 6}
Add a playroom.config.js
file to the root of your project:
1module.exports = { 2 components: './src/components', 3 outputPath: './dist/playroom', 4 5 // Optional: 6 title: 'My Awesome Library', 7 themes: './src/themes', 8 snippets: './playroom/snippets.js', 9 frameComponent: './playroom/FrameComponent.js', 10 scope: './playroom/useScope.js', 11 widths: [320, 768, 1024], 12 port: 9000, 13 openBrowser: true, 14 paramType: 'search', // default is 'hash' 15 exampleCode: ` 16 <Button> 17 Hello World! 18 </Button> 19 `, 20 baseUrl: '/playroom/', 21 webpackConfig: () => ({ 22 // Custom webpack config goes here... 23 }), 24 iframeSandbox: 'allow-scripts', 25 defaultVisibleWidths: [ 26 // subset of widths to display on first load 27 ], 28 defaultVisibleThemes: [ 29 // subset of themes to display on first load 30 ], 31};
Note: port
and openBrowser
options will be set to 9000
and true
(respectively) by default whenever they are omitted from the config above.
Your components
file is expected to export a single object or a series of named exports. For example:
1export { default as Text } from '../Text'; // Re-exporting a default export 2export { Button } from '../Button'; // Re-exporting a named export 3// etc...
The iframeSandbox
option can be used to set the sandbox
attribute on Playroom's iframe. A minimum of allow-scripts
is required for Playroom to work.
Now that your project is configured, you can start a local development server:
1$ npm run playroom:start
To build your assets for production:
1$ npm run playroom:build
Playroom allows you to quickly insert predefined snippets of code, providing live previews across themes and viewports as you navigate the list. These snippets can be configured via a snippets
file that looks like this:
1export default [ 2 { 3 group: 'Button', 4 name: 'Strong', 5 code: ` 6 <Button weight="strong"> 7 Button 8 </Button> 9 `, 10 }, 11 // etc... 12];
If your components need to be nested within custom provider components, you can provide a custom React component file via the frameComponent
option, which is a path to a file that exports a component. For example, if your component library has multiple themes:
1import React from 'react'; 2import { ThemeProvider } from '../path/to/your/theming-system'; 3 4export default function FrameComponent({ theme, children }) { 5 return <ThemeProvider theme={theme}>{children}</ThemeProvider>; 6}
You can provide extra variables within the scope of your JSX via the scope
option, which is a path to a file that exports a useScope
Hook that returns a scope object. For example, if you wanted to expose a context-based theme
variable to consumers of your Playroom:
1// scope.js 2 3import { useTheme } from '../path/to/your/theming-system'; 4 5export default function useScope() { 6 return { 7 theme: useTheme(), 8 }; 9}
CSS authored inside style
tags with a jsx
attribute will be formatted as CSS. This takes advantage of prettier's embedded language formatting capabilities.
For example:
1<style jsx> 2 {` 3 .foo { 4 color: red; 5 } 6 `} 7</style>
If your component library has multiple themes, you can customise Playroom to render every theme simultaneously via the themes
configuration option.
Similar to your components
file, your themes
file is expected to export a single object or a series of named exports. For example:
1export { themeA } from './themeA'; 2export { themeB } from './themeB'; 3// etc...
If a tsconfig.json
file is present in your project, static prop types are parsed using react-docgen-typescript to provide better autocompletion in the Playroom editor.
[!NOTE] By default, all
.ts
and.tsx
files in the current working directory are included, excludingnode_modules
.
If you need to customise this behaviour, you set the typeScriptFiles
property in your playroom.config.js
.
This property accepts an array of tinyglobby
-compatible globs.
1module.exports = { 2 // ... 3 typeScriptFiles: ['src/components/**/*.{ts,tsx}', '!**/node_modules'], 4};
If you need to customise the parser options, you can set the reactDocgenTypescriptConfig
property in your playroom.config.js
.
For example:
1module.exports = { 2 // ... 3 reactDocgenTypescriptConfig: { 4 propFilter: (prop, component) => { 5 // ... 6 }, 7 }, 8};
Playroom supports loading ESM configuration files. By default, Playroom will look for a playroom config file with either a .js
, .mjs
or .cjs
file extension.
If you are interested in integrating Playroom into Storybook, check out storybook-addon-playroom.
Playroom is built to work on the latest stable versions of all major browsers. Some features may not work as expected in older browsers.
MIT.
No vulnerabilities found.
Reason
28 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
all changesets reviewed
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
12 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More