Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
react-demo-tab
Advanced tools
Easily create React demo components
npm install react-demo-tab
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'));
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.
Instead of manually creating demos, automate the process with DemoZap CLI.
Easily set up a local development environment!
Build project and start storybook on localhost:
npm install
npm start
Start coding! 🎉
All contributions are welcome!
FAQs
Easily create React demo components
The npm package react-demo-tab receives a total of 47 weekly downloads. As such, react-demo-tab popularity was classified as not popular.
We found that react-demo-tab demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.