1.3.26 • Published 9 months ago

react-demo-tab v1.3.26

Weekly downloads
4
License
MIT
Repository
github
Last release
9 months ago

React DemoTab 📑

npm version CI semantic-release TypeScript

Easily create React demo components

Demo

Install

npm install react-demo-tab

Example

npm.io

import ReactDOM from 'react-dom';
import DemoTab from 'react-demo-tab';
import DemoComponent from './ButtonGreen';

const demoCode = `
import './ButtonGreen.css';

const ButtonGreen = () => <button className="btn-green">Green Button</button>;
export default ButtonGreen;`;

const demoStyle = `
.btn-green {
  background-color: green;
  font-size: 14px;
  padding: 12px 26px;
  border-radius: 6px;
}`;

const App = () => {
  return (
    <DemoTab code={demoCode} style={demoStyle}>
      <DemoComponent />
    </DemoTab>
  );
};

ReactDOM.render(<App />, document.getElementById('root'));

Props

Create demo of component that is passed as a child.

Below is the complete list of possible props and their options:

▶︎ indicates optional prop with default value

code: string
Demo code. Required.

style: string ▶︎ undefined
Demo style.

codeExt: 'jsx' | 'tsx' ▶︎ jsx
Code file extension for image to be displayed.

styleExt: 'css' | 'scss' ▶︎ css
Style file extension for image to be displayed.

Create demos with CLI

Instead of manually creating demos, automate the process with DemoZap CLI.

Development

Easily set up a local development environment!

Build project and start storybook on localhost:

  • clone
  • npm install
  • npm start

Start coding! 🎉

Built with DemoTab

Contributing

All contributions are welcome!

1.3.10

10 months ago

1.3.13

10 months ago

1.3.14

10 months ago

1.3.11

10 months ago

1.3.12

10 months ago

1.3.17

10 months ago

1.3.18

10 months ago

1.3.15

10 months ago

1.3.16

10 months ago

1.3.19

10 months ago

1.3.20

9 months ago

1.3.21

9 months ago

1.3.25

9 months ago

1.3.22

9 months ago

1.3.26

9 months ago

1.3.9

3 years ago

1.3.7

3 years ago

1.3.6

3 years ago

1.3.8

3 years ago

1.2.0

3 years ago

1.0.2

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

1.0.9

3 years ago

1.3.5

3 years ago

1.0.8

3 years ago

1.3.4

3 years ago

1.0.7

3 years ago

1.3.3

3 years ago

1.0.6

3 years ago

1.3.2

3 years ago

1.0.5

3 years ago

1.3.1

3 years ago

1.0.4

3 years ago

1.3.0

3 years ago

1.0.3

3 years ago

1.0.10

3 years ago

1.2.18

5 years ago

1.2.17

6 years ago

1.2.16

6 years ago

1.2.15

6 years ago

1.2.14

6 years ago

1.2.13

6 years ago

1.2.1

6 years ago