All Projects → seek-oss → Playroom

seek-oss / Playroom

Licence: mit
Design with JSX, powered by your own component library.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
Less
1899 projects

Projects that are alternatives of or similar to Playroom

Html Sketchapp Cli
Quickly generate Sketch libraries from HTML documents and living style guides, powered by html-sketchapp
Stars: ✭ 631 (-84.35%)
Mutual labels:  design, design-systems, front-end
meetup
For organizing the design systems meetup in NYC.
Stars: ✭ 23 (-99.43%)
Mutual labels:  design, design-systems, front-end
Argon Design System
Argon - Design System for Bootstrap 4 by Creative Tim
Stars: ✭ 2,307 (-42.8%)
Mutual labels:  design, design-systems
Awesome Design Systems
A curated list of bookmarks, resources and articles about design systems focused on developers.
Stars: ✭ 222 (-94.5%)
Mutual labels:  design, design-systems
Design
🎨 Everything Design related in OSCA
Stars: ✭ 23 (-99.43%)
Mutual labels:  design, design-systems
Tachyons
Functional css for humans
Stars: ✭ 11,057 (+174.16%)
Mutual labels:  design, design-systems
Portfolio
📰 Meu portfólio criado com o objetivo de mostrar meus projetos recentes e futuros ao longo da minha carreira.
Stars: ✭ 178 (-95.59%)
Mutual labels:  design, front-end
Webdevscom
😍 All kinds of resources for Developers 🔱 in one place.
Stars: ✭ 364 (-90.97%)
Mutual labels:  design, design-systems
React Color Tools
A set of tools as React components for working with colors 🎨
Stars: ✭ 87 (-97.84%)
Mutual labels:  design, design-systems
Modulz Original Design System Archive
An open-source design system for building scalable, responsive websites and applications.
Stars: ✭ 300 (-92.56%)
Mutual labels:  design, design-systems
Input Range Scss
Styling Cross-Browser Compatible Range Inputs with Sass
Stars: ✭ 272 (-93.26%)
Mutual labels:  design, front-end
Prism
Gett's Design System code generator. Use Zeplin Styleguides as your R&D's Single Source of Truth.
Stars: ✭ 308 (-92.36%)
Mutual labels:  design, design-systems
Theme Specification
A specification for defining theme objects & design tokens for use with UI components
Stars: ✭ 374 (-90.73%)
Mutual labels:  design, design-systems
Ui Ux
📝 Curated list for UI/UX Designers
Stars: ✭ 125 (-96.9%)
Mutual labels:  design, design-systems
Webgradients
A curated collection of splendid gradients made in CSS3, .sketch and .PSD formats.
Stars: ✭ 2,197 (-45.52%)
Mutual labels:  design, front-end
Tachyons Verbose
Functional CSS for humans. Verbose edition.
Stars: ✭ 102 (-97.47%)
Mutual labels:  design, design-systems
Mdx Go
⚡️ Lightning fast MDX-based dev server for progressive documentation
Stars: ✭ 340 (-91.57%)
Mutual labels:  design, design-systems
Neumorphic Ui
📚 A library of components based on the concept of neumorphism
Stars: ✭ 82 (-97.97%)
Mutual labels:  design, design-systems
Patternfly Design
Use this repo to file all new feature or design change requests for the PatternFly project
Stars: ✭ 82 (-97.97%)
Mutual labels:  design, front-end
Welcome Ui
Customizable design system of @wttj with react • styled-components • styled-system • reakit
Stars: ✭ 256 (-93.65%)
Mutual labels:  design, design-systems

Playroom

npm Build Status


Playroom Demo

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.

  • Iterate on your designs in the final medium.
  • Create quick mock-ups and interactive prototypes with real code.
  • Exercise and evaluate the flexibility of your design system.
  • Share your work with others by simply copying the URL.

Demos

Braid Design System (Themed)

Bumbag

Overdrive

Cubes (Themed)

Mesh Design System (Themed)

Mística Design System (Themed)

Send us a PR if you'd like to be in this list!

Getting Started

$ npm install --save-dev playroom

Add the following scripts to your package.json:

{
  "scripts": {
    "playroom:start": "playroom start",
    "playroom:build": "playroom build"
  }
}

Add a playroom.config.js file to the root of your project:

module.exports = {
  components: './src/components',
  outputPath: './dist/playroom',

  // Optional:
  title: 'My Awesome Library',
  themes: './src/themes',
  snippets: './playroom/snippets.js',
  frameComponent: './playroom/FrameComponent.js',
  scope: './playroom/useScope.js',
  widths: [320, 768, 1024],
  port: 9000,
  openBrowser: true,
  paramType: 'search', // default is 'hash'
  exampleCode: `
    <Button>
      Hello World!
    </Button>
  `,
  baseUrl: '/playroom/',
  webpackConfig: () => ({
    // Custom webpack config goes here...
  }),
  iframeSandbox: 'allow-scripts',
};

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:

export { default as Text } from '../Text'; // Re-exporting a default export
export { Button } from '../Button'; // Re-exporting a named export
// 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:

$ npm run playroom:start

To build your assets for production:

$ npm run playroom:build

Snippets

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:

export default [
  {
    group: 'Button',
    name: 'Strong',
    code: `
      <Button weight="strong">
        Button
      </Button>
    `,
  },
  // etc...
];

Custom Frame Component

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:

import React from 'react';
import { ThemeProvider } from '../path/to/your/theming-system';

export default function FrameComponent({ theme, children }) {
  return <ThemeProvider theme={theme}>{children}</ThemeProvider>;
}

Custom Scope

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:

import { useTheme } from '../path/to/your/theming-system';

export default function useScope() {
  return {
    theme: useTheme(),
  };

Theme Support

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:

export { themeA } from './themeA';
export { themeB } from './themeB';
// etc...

TypeScript Support

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.

By default, all .ts and .tsx files in the current working directory are included, excluding node_modules.

If you need to customise this behaviour, you can provide a typeScriptFiles option in playroom.config.js, which is an array of globs.

module.exports = {
  // ...
  typeScriptFiles: ['src/components/**/*.{ts,tsx}', '!**/node_modules'],
};

If you need to customise the parser options, you can provide a reactDocgenTypescriptConfig option in playroom.config.js.

For example:

module.exports = {
  // ...
  reactDocgenTypescriptConfig: {
    propFilter: (prop, component) => {
      // ...
    },
  },
};

Storybook Integration

If you are interested in integrating Playroom into Storybook, check out storybook-addon-playroom.

License

MIT.

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].