Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

zicodeng/docz-iframe-playground

Repository files navigation

Docz IFrame Playground

The default Docz <Playground> is really cool, but it does not serve your components in an isolated browsing context. This means your components live in a shared document environment with the Docz theme

The disadvantages of shared browsing context are:

  • It makes developers hard to test component responsiveness
  • Possible CSS collisions between Docz default theme style and component style

This project aims to solve the issue by using <iframe>

Demo

Playground: https://zicodeng.github.io/docz-iframe-playground/

Installation

yarn add -D docz-iframe-playground

Usage

---
name: IFramePlayground
route: /
---
import { Playground, PropsTable } from 'docz';
import IFramePlayground from './../src/IFramePlayground';
import Header from './../helpers/Header';
import TestComponent from './TestComponent';
<Header />
## Demo
### You can nest `<IFramePlayground>` under `<Playground>`
<Playground>
 <TestComponent title="Not Using IFramePlayground" />
 <IFramePlayground style={{ marginTop: 50 }}>
 <TestComponent title="Using IFramePlayground" />
 </IFramePlayground>
</Playground>
### You can also use standalone `<IFramePlayground>`
Make sure to turn on `enableResizing`
<IFramePlayground enableResizing maxHeight={800}>
 <TestComponent title="Using IFramePlayground" height="100%" />
</IFramePlayground>
## API
<PropsTable of={IFramePlayground} />

About

iframe wrapper for Docz playground

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /