seek-oss/playroom là dự án tập trung thiết kế trên GitHub với 4.6k sao, viết chủ yếu bằng TypeScript. Design with JSX, powered by your own component library.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
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.
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:
The group property is optional, but if provided, snippets will be grouped together in the UI under the specified group name.
The description property is also optional and can be used to help differentiate similar snippets.
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>;
}
The FrameComponent receives the following props:
theme - The currently selected theme (if themes are configured)
themeName - The name of the currently selected theme
frameSettings - An object containing the current values of frame settings (if configured)
children - The rendered playroom code
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:
// scope.js
import { useTheme } from '../path/to/your/theming-system';
export default function useScope() {
return {
theme: useTheme(),
};
}
Embedded CSS Formatting
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:
<style jsx>
{`
.foo {
color: red;
}
`}
</style>
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...
Frame Settings
Playroom allows you to define configurable boolean toggles that users can control for each frame independently. This is useful for testing components under different conditions (e.g., RTL layout, debugging touch targets, etc).
You can configure frame settings via the frameSettings option in your config:
When frame settings are configured, a settings icon will appear in each frame's action bar enabling users to toggle individual settings.
Using Frame Settings in Your Frame Component
Frame settings are passed to your custom FrameComponent as the frameSettings prop, which is an object mapping setting IDs to their boolean values:
import React from 'react';
import { ThemeProvider } from '../path/to/your/theming-system';
export default function FrameComponent({ theme, frameSettings, children }) {
return (
<ThemeProvider theme={theme} rtl={frameSettings?.rtl}>
<div
className={
frameSettings?.showTouchTargets ? 'showTouchTargets' : undefined
}
>
{children}
</div>
</ThemeProvider>
);
}
Frame Settings Behavior
Per-frame state: Each frame (theme/width combination) maintains independent settings
Session-only: Settings are stored in memory and reset on page refresh
Not persisted: Settings are not included in shared URLs or local storage
This allows users to quickly compare how components behave under different configurations across multiple frames simultaneously.
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.
[!NOTE]
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 set the typeScriptFiles property in your playroom.config.js.
This property accepts an array of tinyglobby-compatible globs.
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.
Storybook Integration
If you are interested in integrating Playroom into Storybook, check out storybook-addon-playroom.
Browser Support
Playroom is built to work on the latest stable versions of all major browsers. Some features may not work as expected in older browsers.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/seek-oss/playroom là nguồn chính thức.
seek-oss/playroom có bao nhiêu sao?
seek-oss/playroom có 4.6k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/seek-oss/playroom. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
seek-oss/playroom có phải mã nguồn mở không?
Có — seek-oss/playroom phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/seek-oss/playroom.
seek-oss/playroom còn đang phát triển không?
Commit gần nhất trên seek-oss/playroom là 5 ngày trước (theo timestamp GitHub). Repo có 188 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
seek-oss/playroom là gì?
seek-oss/playroom (seek-oss/playroom) là dự án TypeScript trên GitHub. Theo mô tả gốc: Design with JSX, powered by your own component library.
seek-oss/playroom so với các dự án UI / UX khác thế nào?
seek-oss/playroom được TopGit xếp vào nhóm UI / UX, với 4.6k sao GitHub và viết bằng TypeScript. Xem trang chủ đề UI / UX trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
playroom có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về playroom.