react-stackblitz-snippet

0.2.0 • Public • Published

react-stackblitz-snippet

React Component to generate a Stackblitz Editor

Installation

yarn add react-stackblitz-snippet

or

npm i react-stackblitz-snippet --save

Usage

  1. import:
import { Stackblitz } from 'react-stackblitz-snippet';
  1. Use:
<Stackblitz>
  <file name="index.html" content="<h1>Hello</h1>" />
  <file name="index.ts" open>console.log("hello stackblitz!!");</file>
</Stackblitz>

Options

The file children can be used to easily add snippet code (see Usage). The open flag defines which file will be opened by default.

Demo

Open Demo in Stackblitz or clone the repo and run npm start!

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.2.02latest

Version History

VersionDownloads (Last 7 Days)Published
0.2.02
0.1.00

Package Sidebar

Install

npm i react-stackblitz-snippet

Weekly Downloads

2

Version

0.2.0

License

MIT

Unpacked Size

3.03 kB

Total Files

5

Last publish

Collaborators

  • felixroos